From b6b813cbfcf1a440a4a3b5eb10f55cfc85c4e3f3 Mon Sep 17 00:00:00 2001 From: Andy Finch Date: Mon, 18 Nov 2019 21:13:04 -0500 Subject: feat: op registration during calls (#3375) --- core/isolate.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core/isolate.rs') diff --git a/core/isolate.rs b/core/isolate.rs index 079ab5dcf..41c8b02fd 100644 --- a/core/isolate.rs +++ b/core/isolate.rs @@ -178,7 +178,7 @@ pub struct Isolate { pending_dyn_imports: FuturesUnordered>>, have_unpolled_ops: bool, startup_script: Option, - op_registry: OpRegistry, + pub op_registry: Arc, eager_poll_count: u32, waker: AtomicWaker, } @@ -245,7 +245,7 @@ impl Isolate { have_unpolled_ops: false, pending_dyn_imports: FuturesUnordered::new(), startup_script, - op_registry: OpRegistry::new(), + op_registry: Arc::new(OpRegistry::new()), eager_poll_count: 0, waker: AtomicWaker::new(), } @@ -256,7 +256,7 @@ impl Isolate { /// corresponds to the second argument of Deno.core.dispatch(). /// /// Requires runtime to explicitly ask for op ids before using any of the ops. - pub fn register_op(&mut self, name: &str, op: F) -> OpId + pub fn register_op(&self, name: &str, op: F) -> OpId where F: Fn(&[u8], Option) -> CoreOp + Send + Sync + 'static, { -- cgit v1.2.3