From d8ada4d3fcc5dfe7f76103399a1d765fbab2ee45 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Mon, 26 Aug 2019 10:58:44 -0400 Subject: 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. --- cli/ops/dispatch_minimal.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'cli/ops/dispatch_minimal.rs') 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) -- cgit v1.2.3