diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-10-09 19:08:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-09 19:08:10 +0200 |
commit | f4357f0ff9d39411f22504fcc20db6bd5dec6ddb (patch) | |
tree | 2144868cd857744558596402e356a691701b4cb3 /cli/ops/worker_host.rs | |
parent | 9731cbc2881ae3052100d03662a3d69f5e3d2ae8 (diff) |
refactor: Worker is not a Future (#7895)
This commit rewrites deno::Worker to not implement Future
trait.
Instead there are two separate methods:
- Worker::poll_event_loop() - does single tick of event loop
- Worker::run_event_loop() - runs event loop to completion
Additionally some cleanup to Worker's field visibility was done.
Diffstat (limited to 'cli/ops/worker_host.rs')
-rw-r--r-- | cli/ops/worker_host.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cli/ops/worker_host.rs b/cli/ops/worker_host.rs index 6d74bb9f4..0b36e2c47 100644 --- a/cli/ops/worker_host.rs +++ b/cli/ops/worker_host.rs @@ -173,7 +173,8 @@ fn run_worker_thread( // TODO(bartlomieju): this thread should return result of event loop // that means that we should store JoinHandle to thread to ensure // that it actually terminates. - rt.block_on(worker).expect("Panic in event loop"); + rt.block_on(worker.run_event_loop()) + .expect("Panic in event loop"); debug!("Worker thread shuts down {}", &name); })?; |