diff options
author | andy finch <andyfinch7@gmail.com> | 2019-04-01 15:09:59 -0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-04-01 15:09:59 -0400 |
commit | b0a23beb8fae964be3cdd8c23c38af66257d34c7 (patch) | |
tree | 8f7875c8ca059dfb0a3ade4da7bfb94e57d6e1aa /cli/resources.rs | |
parent | 659acadf77fdbeef8579a37839a464feb408437a (diff) |
Add web worker JS API (#1993)
* Refactored the way worker polling is scheduled and errors are handled.
* Share the worker future as a Shared
Diffstat (limited to 'cli/resources.rs')
-rw-r--r-- | cli/resources.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cli/resources.rs b/cli/resources.rs index 5b08e4b32..817f6062d 100644 --- a/cli/resources.rs +++ b/cli/resources.rs @@ -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 } } |