mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 20:59:10 +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
|
@ -1,7 +1,6 @@
|
|||
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
||||
|
||||
use crate::colors;
|
||||
use crate::inspector::DenoInspector;
|
||||
use crate::inspector::InspectorSession;
|
||||
use deno_core::error::AnyError;
|
||||
use deno_core::serde_json;
|
||||
|
@ -14,8 +13,7 @@ pub struct CoverageCollector {
|
|||
}
|
||||
|
||||
impl CoverageCollector {
|
||||
pub fn new(inspector_ptr: *mut DenoInspector) -> Self {
|
||||
let session = InspectorSession::new(inspector_ptr);
|
||||
pub fn new(session: Box<InspectorSession>) -> Self {
|
||||
Self { session }
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue