Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

async_wrap: polyfill #8

Closed
Qard opened this issue Mar 20, 2015 · 9 comments
Closed

async_wrap: polyfill #8

Qard opened this issue Mar 20, 2015 · 9 comments

Comments

@Qard
Copy link
Member

Qard commented Mar 20, 2015

We need a polyfill for the async_wrap API to use in older versions of node/io.js.

It'll need roughly the same monkey-patching that async-listener does, but triggering slightly different things from the calls. Some changes will need to be made to pass around handles.

Concerns:

  • Availability of handles on this object of patched functions
  • Availability of handles in older node/io.js versions (@trevnorris Comments?)
@trevnorris
Copy link

Reaching full parody would be very difficult. Since the init callbacks are called when the C++ class is instantiated, and has no regard for what's happening in JS. Also it's flat impossible for FS because there is no created JS handle.

@Qard
Copy link
Member Author

Qard commented Mar 20, 2015

Yes, I expected some things--handle in particular--would simply not be accessible in past versions.

As for init callbacks, is there a particular case in which you think it'd be an issue to monkey-patch the call itself to represent init, rather than the C++ class instantiation? Other than the slightly different timing, the order of operations should still be the same, shouldn't it? There might be a bit of internal work going on between but, as far as I know, there's nothing that'd be jumping back into JS or triggering other async_wrap events, is there?

@trevnorris
Copy link

@Qard Just need to be careful you're patching the correct thing. e.g. you'd have to patch Server#listen() instead of Server(). Because the call to TCPWrap/PipeWrap isn't made until listen() is called b/c it isn't known until that point whether it's a socket or port.

@Qard
Copy link
Member Author

Qard commented Mar 23, 2015

That sounds fine to me. I might actually just go straight for the binding function and patch stuff there. We'll see.

@avanderhoorn
Copy link

Did you ever have any luck here, what approach did you end up going with?

@Qard
Copy link
Member Author

Qard commented Jan 9, 2016

Haven't taken the time to do anything with it due to the API not being very stable for awhile.

@trevnorris Is async_wrap in a stable enough state at this point that it'd make sense to start working on this?

@trevnorris
Copy link

@Qard Actually I'm trying to get it ready to be "public" API so have been working on several things. So I'd say expect more changes for the next little while, but also they'll most likely be smaller changes.

@Qard
Copy link
Member Author

Qard commented Jan 12, 2016

Yeah, I was aware there was some effort going into preparing it to go public, but I didn't know what that meant for short-term API stability. I'll take another look when it's ready to go public to see if I can get a decent polyfill put together. 😸

@joshgav
Copy link
Contributor

joshgav commented Sep 21, 2016

closing old AsyncWrap issues, please start a new thread if appropriate

@joshgav joshgav closed this as completed Sep 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants