From b0a23beb8fae964be3cdd8c23c38af66257d34c7 Mon Sep 17 00:00:00 2001 From: andy finch Date: Mon, 1 Apr 2019 15:09:59 -0400 Subject: Add web worker JS API (#1993) * Refactored the way worker polling is scheduled and errors are handled. * Share the worker future as a Shared --- cli/resources.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'cli/resources.rs') 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> { @@ -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 } } -- cgit v1.2.3