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

Support `uv_async_send` for background task notifications #228

jugglingcats opened this issue Aug 22, 2017 · 0 comments

Support `uv_async_send` for background task notifications #228

jugglingcats opened this issue Aug 22, 2017 · 0 comments


Copy link

@jugglingcats jugglingcats commented Aug 22, 2017

I'm raising this because #26 and #214 take care nicely of the primary use case for async using uv_queue_work but there is another scenario that would be good to support long term IMO.

The uv_queue_work method caters for a long running Javascript method returning immediately and then invoking a callback sometime later. This is good for a lot of cases. It uses the node thread pool.

However our scenario is that we invoke a Javascript method which should then create a new Rust thread, rather than use the node thread pool. This thread runs potentially forever but needs to communicate back to Javascript via the node event loop. This is what uv_async_send is designed for (with a caveat -- multiple calls to uv_async_send may be coalesced).

It would be great to have this supported at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.