refactor(core): JsRuntime is not a Future (#7855)

This commit rewrites deno_core::JsRuntime to not implement Future
trait.

Instead there are two separate methods:
- JsRuntime::poll_event_loop() - does single tick of event loop
- JsRuntime::run_event_loop() - runs event loop to completion
This commit is contained in:
Bartek Iwańczuk 2020-10-07 22:30:06 +02:00 committed by GitHub
parent 8bd7c936f9
commit d8879feb8c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 73 additions and 66 deletions

View file

@ -240,7 +240,7 @@ impl Future for Worker {
// We always poll the inspector if it exists.
let _ = inner.inspector.as_mut().map(|i| i.poll_unpin(cx));
inner.waker.register(cx.waker());
inner.js_runtime.poll_unpin(cx)
inner.js_runtime.poll_event_loop(cx)
}
}