Replies: 2 comments 1 reply
-
Hi. Do you have any updates here? |
Beta Was this translation helpful? Give feedback.
1 reply
-
Are you using napi-rs or rolling your own integration? EDIT: Found napi-rs/napi-rs#2152 and https://github.com/alshdavid/napi_ext |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey all, I am trying to bolt tokio onto an external event loop (libuv via a Nodejs addon).
For this, I need to enter tokio and manually drive futures to completion using a current thread scheduler which does not block if there are pending futures.
Essentially, I need it to loop over all of the internal futures, poll them, continuing on pending futures.
Currently tokio only has the
block_on
method which blocks the main thread (consequently blocking the external event loop). I essentially need atry_next_tick()
method.I've been trying to reconstruct the
CurrentThread
scheduler in user code but almost all of the internals required to do this are private to the tokio crate - and I don't want to fork Tokio.Is there an obvious way to achieve this that I am missing?
I was able to achieve this successfully with
smol::LocalExecutor::try_tick()
but I'd rather use Tokio.Trying to get this working with Tokio in a sandbox I am trying the following:
I have tried using a
LocalSet
but I figure if I can run a single future like this, I can run aLocalSet
like this so I am starting simpleEDIT: I am trying to achieve something similar to this
Beta Was this translation helpful? Give feedback.
All reactions