Open iislucas opened 10 years ago
Yes, I think that would be preferable to having to call getInfo() to query the host and port. Ditto for the UDP provider.
Worth thinking about why we would favor this as opposed to the separate calls exposed by chrome, node, and unix sockets.
Good point...I think we would need to keep the getInfo() calls in any case.
node, chrome and unix don't use the nice notion of async by promises, if they did, it would be natural to have listen asynchronously return the IP/PORT. Since we live in a better world, we can eat cake and use promises. :)
On Fri, Jun 6, 2014 at 2:17 PM, trevj notifications@github.com wrote:
Good point...I think we would need to keep the getInfo() calls in any case.
— Reply to this email directly or view it on GitHub https://github.com/freedomjs/freedom/issues/55#issuecomment-45368237.
Lucas Dixon | Google Ideas
node and chrome already return from the listen() callback asynchronously with callbacks about when the operation has completed. Promises should be no different?
I think we're talking cross-purposes... lets chat on Tuesday when I have time. :)
On Wed, Jul 9, 2014 at 7:56 PM, Will notifications@github.com wrote:
node and chrome already return from the listen() callback asynchronously with callbacks about when the operation has completed. Promises should be no different?
— Reply to this email directly or view it on GitHub https://github.com/freedomjs/freedom/issues/55#issuecomment-48550346.
Lucas Dixon | Google Ideas
So I believe this hasn't happened (i.e. current use requires calling listen()
and getInfo()
separately). Is this still something we want to consider?
See: https://github.com/freedomjs/freedom/blob/master/interface/core.js#L105
I suspect listen should probably be giving back the address and port that end up being listened on.