summaryrefslogtreecommitdiff
path: root/cli/ops/worker_host.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2020-10-09 19:08:10 +0200
committerGitHub <noreply@github.com>2020-10-09 19:08:10 +0200
commitf4357f0ff9d39411f22504fcc20db6bd5dec6ddb (patch)
tree2144868cd857744558596402e356a691701b4cb3 /cli/ops/worker_host.rs
parent9731cbc2881ae3052100d03662a3d69f5e3d2ae8 (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.rs3
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);
})?;