Closed MaxDesiatov closed 5 years ago
@explicitcall thanks, Ill take a look!
@explicitcall ok, so first of all, thanks for bringing this to my attention. I did some work here that gets us part of the way there, but there's still some things left to be done to make the request queueing work for multiple sockets. Currently, it's not a use case my team has on our plate so I can't really justify any more time working to make it possible, but I'm more than happy to accept a PR from anyone who needs this feature and has a few minutes to finish the job.
Basically e94e228e68925c4cbd48c5fe5e07de3631b63fb8 sets things up so that each socket instance has a requestQueue
. The requestQueue
is being run when TmpSocket.prototype.become()
gets called. The issue is that TmpSocket
is only being instantiated for the initial io.socket
and not all other sockets. Basically we just need to return a new TmpSocket instance from our io.connect
override, start connecting a real socket (which we already do), then when that realSocket
finishes connecting, we need to call fakeSocket.become(realSocket)
. As I mentioned, this code already exists in the SDK, but as a one-off for io.socket-- the next step is to make it generic.
Thanks again!
Made an issue for the multi-socket use case here so we can go ahead and close this one
@explicitcall just released sails.io.js@v0.10.0-rc4 to npm and bower with this fix (and a few other improvements)
Link: https://github.com/balderdashy/sails.io.js/releases/tag/v0.10.0-rc4
thank you! will give it a try
steps to reproduce:
example/index.html
example
directory asnode server.js
http://localhost:1337/example/
sails.io.js:459
or somewhere at the linesself.id
isundefined
, so the requests inrequestQueues
will be overwritten if there are more than one