DenoDDeno
Powered by
ExidexE
Denoβ€’3y agoβ€’
11 replies
Exidex

How do I enqueue_microtask from other thread

so
Isolate.enqueue_microtask
Isolate.enqueue_microtask
is obviously not send/sync so I think the only option is to use
 std::sync::mpsc::channel
 std::sync::mpsc::channel
and use
Receiver.try_recv
Receiver.try_recv
to get the values from
Sender
Sender
on other thread. The problem is that I am being a rust newbie don't know how to combine them on the single thread or if it actually possible. I somehow need to wake up the runtime when the
Sender
Sender
actually sends the value, I think I can wrap
try_recv
try_recv
with
poll_fn
poll_fn
and use something like tokio's
select!
select!
macro but that also doesn't seem to fit my problem because I need to be able to restart
run_event_loop
run_event_loop
to process any new microtasks. Any pointers?
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Deno Kv: "Database is locked" on enqueue
zingZzing / help
13mo ago
How do I render react?
slabcacheSslabcache / help
4y ago
How do I view CPU time?
hazrdHhazrd / help
10mo ago
How do I troubleshoot this error?
spencerSspencer / help
16mo ago