summaryrefslogtreecommitdiff
path: root/core/isolate.rs
diff options
context:
space:
mode:
authorAndy Finch <andyfinch7@gmail.com>2019-11-18 21:13:04 -0500
committerRy Dahl <ry@tinyclouds.org>2019-11-18 21:13:04 -0500
commitb6b813cbfcf1a440a4a3b5eb10f55cfc85c4e3f3 (patch)
tree7fe68a6c94ad700d2bf2074274cfcdbe9e8dd87e /core/isolate.rs
parentf437521afb5df52fc9d4b7ee5664dacbf5881e3e (diff)
feat: op registration during calls (#3375)
Diffstat (limited to 'core/isolate.rs')
-rw-r--r--core/isolate.rs6
1 files changed, 3 insertions, 3 deletions
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<StreamFuture<IntoStream<DynImport>>>,
have_unpolled_ops: bool,
startup_script: Option<OwnedScript>,
- op_registry: OpRegistry,
+ pub op_registry: Arc<OpRegistry>,
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<F>(&mut self, name: &str, op: F) -> OpId
+ pub fn register_op<F>(&self, name: &str, op: F) -> OpId
where
F: Fn(&[u8], Option<PinnedBuf>) -> CoreOp + Send + Sync + 'static,
{