Open oberstet opened 6 years ago
In a way, promises left unfired forever are the resource leak kind of bugs in async programming.
So it could be a good idea to add internal bookkeeping to ABJS to track all promises created and returned by the library to user code and make sure we both start and end with an empty list always.
When a connection is lost, the library should fire any outstanding promises for requests (calls, subscribe acknowledged publishes, etc) with error.
Eg ABPy has an
errback_outstanding_requests
function centralizing the code for this: https://github.com/crossbario/autobahn-python/blob/master/autobahn/wamp/protocol.py#L1182We should have similar here in ABJS.