diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-03-09 01:34:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-09 01:34:31 +0100 |
commit | 85cb6f256341b262ef4f0f67ddba034bea3033b1 (patch) | |
tree | 868445cdb59e7520b08173374ca20afbdf1dae61 /cli/ops/testing.rs | |
parent | 22dbbf75f36315d4a203011ff9e37c7e56a7bef0 (diff) |
refactor(test): use tokio::sync::mpsc::unbounded_channel (#13881)
This causes to block one less thread when running "deno test"
subcommand.
Diffstat (limited to 'cli/ops/testing.rs')
-rw-r--r-- | cli/ops/testing.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cli/ops/testing.rs b/cli/ops/testing.rs index 928fb5a20..b8995db83 100644 --- a/cli/ops/testing.rs +++ b/cli/ops/testing.rs @@ -8,10 +8,10 @@ use deno_core::OpState; use deno_runtime::permissions::create_child_permissions; use deno_runtime::permissions::ChildPermissionsArg; use deno_runtime::permissions::Permissions; -use std::sync::mpsc::Sender; +use tokio::sync::mpsc::UnboundedSender; use uuid::Uuid; -pub fn init(sender: Sender<TestEvent>) -> Extension { +pub fn init(sender: UnboundedSender<TestEvent>) -> Extension { Extension::builder() .ops(vec![ ( @@ -84,7 +84,7 @@ fn op_dispatch_test_event( event: TestEvent, _: (), ) -> Result<(), AnyError> { - let sender = state.borrow::<Sender<TestEvent>>().clone(); + let sender = state.borrow::<UnboundedSender<TestEvent>>().clone(); sender.send(event).ok(); Ok(()) |