diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2020-09-10 09:57:45 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-10 09:57:45 -0400 |
commit | 7c2e7c660804afca823d60e6496aa853f75db16c (patch) | |
tree | b7746b181c1564c6b1abd2e906662f9e6b008417 /core/bindings.rs | |
parent | 6f70e6e72ba2d5c1de7495adac37c1e4f4e86b24 (diff) |
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<RefCell<OpState>>`
* sync ops take `&mut OpState`
* removes `OpRegistry`, `OpRouter` traits
* `get_error_class_fn` moved to OpState
* ResourceTable moved to OpState
Diffstat (limited to 'core/bindings.rs')
-rw-r--r-- | core/bindings.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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() => { |