mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 10:59:13 +00:00
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.
This commit is contained in:
parent
9731cbc288
commit
f4357f0ff9
5 changed files with 134 additions and 147 deletions
|
@ -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);
|
||||
})?;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue