diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2020-04-19 23:54:46 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-19 23:54:46 -0400 |
commit | c1ec042a0011eeba2480b892a335ca7804c59180 (patch) | |
tree | 02d9595a3a6be9fb646171be29f59a3c0f74f12f /cli/ops/web_worker.rs | |
parent | 4e3532fe7b61a1050b00611081cc83af8b02de70 (diff) |
Modify op dispatcher to include &mut Isolate argument (#4821)
- Removes unnecessary RwLock and Rc around the op registry table
- Preparation to move resource_table to deno_core::Isolate.
- Towards #3453, #4222
Diffstat (limited to 'cli/ops/web_worker.rs')
-rw-r--r-- | cli/ops/web_worker.rs | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/cli/ops/web_worker.rs b/cli/ops/web_worker.rs index 8cade7d40..ee376719f 100644 --- a/cli/ops/web_worker.rs +++ b/cli/ops/web_worker.rs @@ -12,7 +12,11 @@ use std::convert::From; pub fn web_worker_op<D>( sender: mpsc::Sender<WorkerEvent>, dispatcher: D, -) -> impl Fn(Value, Option<ZeroCopyBuf>) -> Result<JsonOp, OpError> +) -> impl Fn( + &mut deno_core::Isolate, + Value, + Option<ZeroCopyBuf>, +) -> Result<JsonOp, OpError> where D: Fn( &mpsc::Sender<WorkerEvent>, @@ -20,7 +24,8 @@ where Option<ZeroCopyBuf>, ) -> Result<JsonOp, OpError>, { - move |args: Value, + move |_isolate: &mut deno_core::Isolate, + args: Value, zero_copy: Option<ZeroCopyBuf>| -> Result<JsonOp, OpError> { dispatcher(&sender, args, zero_copy) } } @@ -29,7 +34,11 @@ pub fn web_worker_op2<D>( handle: WebWorkerHandle, sender: mpsc::Sender<WorkerEvent>, dispatcher: D, -) -> impl Fn(Value, Option<ZeroCopyBuf>) -> Result<JsonOp, OpError> +) -> impl Fn( + &mut deno_core::Isolate, + Value, + Option<ZeroCopyBuf>, +) -> Result<JsonOp, OpError> where D: Fn( WebWorkerHandle, @@ -38,7 +47,8 @@ where Option<ZeroCopyBuf>, ) -> Result<JsonOp, OpError>, { - move |args: Value, + move |_isolate: &mut deno_core::Isolate, + args: Value, zero_copy: Option<ZeroCopyBuf>| -> Result<JsonOp, OpError> { dispatcher(handle.clone(), &sender, args, zero_copy) |