From 7c2e7c660804afca823d60e6496aa853f75db16c Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Thu, 10 Sep 2020 09:57:45 -0400 Subject: Use gotham-like state for ops (#7385) Provides a concrete state type that can be dynamically added. This is necessary for op crates. * renames BasicState to OpState * async ops take `Rc>` * sync ops take `&mut OpState` * removes `OpRegistry`, `OpRouter` traits * `get_error_class_fn` moved to OpState * ResourceTable moved to OpState --- core/bindings.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/bindings.rs') diff --git a/core/bindings.rs b/core/bindings.rs index d0d916bdc..265906990 100644 --- a/core/bindings.rs +++ b/core/bindings.rs @@ -6,6 +6,7 @@ use crate::JsRuntime; use crate::JsRuntimeState; use crate::Op; use crate::OpId; +use crate::OpTable; use crate::ZeroCopyBuf; use futures::future::FutureExt; use rusty_v8 as v8; @@ -426,8 +427,7 @@ fn send<'s>( } }; - let op_router = state.op_router.clone(); - let op = op_router.route_op(op_id, bufs); + let op = OpTable::route_op(op_id, state.op_state.clone(), bufs); assert_eq!(state.shared.size(), 0); match op { Op::Sync(buf) if !buf.is_empty() => { -- cgit v1.2.3