Open topaxi opened 8 years ago
Hey!
Thank you taking the time to report this! You're right, they are sync now indeed. I wonder if there are any implications in making connection
it async. Don't seem to be.
You could in theory until then listen to the connect
event on the server-side socket and unsubscribe there. The server socket is the first argument passed to the connection
event.
Given something like:
The subscription will be
undefined
in theconnection
event, this makes it kinda hard to write tests without introducing manualprocess.nextTick(...)
calls. I've tried putting thesubscribe()
call below the 'connection' event, but this won't work asconnection
will be triggered inside mysubscribe
call (because Mitm seems to make this sync).