interledger-deprecated / ilp-core

Core ILP module — handles ledger abstraction and quoting
Other
8 stars 5 forks source link

Warning about event listeners when 10+ messages are in flight #70

Closed emschwartz closed 7 years ago

emschwartz commented 7 years ago

Right now the client adds a new listener on the plugin for every message that's in flight and waiting for a response. This means that if it has more than 10 messages waiting for responses, it will trigger the warning about a potential memory leak.

Instead of adding a listener for each request, I think it would be better to have one listener for incoming_message. The handler would look up the corresponding resolve and reject functions by the requestId in a map on the client.

Credit to @dappelt for discovering this.