mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
Add web worker JS API (#1993)
* Refactored the way worker polling is scheduled and errors are handled. * Share the worker future as a Shared
This commit is contained in:
parent
659acadf77
commit
b0a23beb8f
28 changed files with 1013 additions and 257 deletions
|
@ -305,7 +305,8 @@ pub fn add_worker(wc: WorkerChannels) -> Resource {
|
|||
Resource { rid }
|
||||
}
|
||||
|
||||
pub fn worker_post_message(
|
||||
/// Post message to worker as a host or privilged overlord
|
||||
pub fn post_message_to_worker(
|
||||
rid: ResourceId,
|
||||
buf: Buf,
|
||||
) -> futures::sink::Send<futures::sync::mpsc::Sender<Buf>> {
|
||||
|
@ -341,7 +342,7 @@ impl Future for WorkerReceiver {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn worker_recv_message(rid: ResourceId) -> WorkerReceiver {
|
||||
pub fn get_message_from_worker(rid: ResourceId) -> WorkerReceiver {
|
||||
WorkerReceiver { rid }
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue