diff options
Diffstat (limited to 'runtime/ops/web_worker.rs')
-rw-r--r-- | runtime/ops/web_worker.rs | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/runtime/ops/web_worker.rs b/runtime/ops/web_worker.rs index 5f63a03b7..68cef110c 100644 --- a/runtime/ops/web_worker.rs +++ b/runtime/ops/web_worker.rs @@ -12,7 +12,7 @@ pub fn init( ) { // Post message to host as guest worker. let sender_ = sender.clone(); - super::reg_json_sync( + super::reg_sync( rt, "op_worker_post_message", move |_state, _args: (), buf| { @@ -27,15 +27,11 @@ pub fn init( ); // Notify host that guest worker closes. - super::reg_json_sync( - rt, - "op_worker_close", - move |_state, _args: (), _bufs| { - // Notify parent that we're finished - sender.clone().close_channel(); - // Terminate execution of current worker - handle.terminate(); - Ok(()) - }, - ); + super::reg_sync(rt, "op_worker_close", move |_state, _args: (), _bufs| { + // Notify parent that we're finished + sender.clone().close_channel(); + // Terminate execution of current worker + handle.terminate(); + Ok(()) + }); } |