diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2019-08-26 10:58:44 -0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-08-26 14:56:42 -0400 |
commit | d8ada4d3fcc5dfe7f76103399a1d765fbab2ee45 (patch) | |
tree | 2209cb60cd537d1da5c1687ab2b7996655654c06 /cli/ops/dispatch_minimal.rs | |
parent | 7ff67017f2153eeed393da670777ff85df2801ca (diff) |
Port readSync/writeSync ops to minimal
This removes dispatch_flatbuffers as it is now unused. There are still a
few places where msg_generated is used: ErrorKind and MediaType. These
will be dealt with later.
Diffstat (limited to 'cli/ops/dispatch_minimal.rs')
-rw-r--r-- | cli/ops/dispatch_minimal.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/cli/ops/dispatch_minimal.rs b/cli/ops/dispatch_minimal.rs index 22d0a92f8..f52893951 100644 --- a/cli/ops/dispatch_minimal.rs +++ b/cli/ops/dispatch_minimal.rs @@ -80,9 +80,6 @@ pub fn dispatch( ) -> CoreOp { let mut record = parse_min_record(control).unwrap(); let is_sync = record.promise_id == 0; - // TODO(ry) Currently there aren't any sync minimal ops. This is just a sanity - // check. Remove later. - assert!(!is_sync); let rid = record.arg; let min_op = d(rid, zero_copy); @@ -102,6 +99,11 @@ pub fn dispatch( })); if is_sync { + // Warning! Possible deadlocks can occur if we try to wait for a future + // while in a future. The safe but expensive alternative is to use + // tokio_util::block_on. + // This block is only exercised for readSync and writeSync, which I think + // works since they're simple polling futures. Op::Sync(fut.wait().unwrap()) } else { Op::Async(fut) |