mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 04:39:10 +00:00
workers: basic event loop (#3828)
* establish basic event loop for workers * make "self.close()" inside worker * remove "runWorkerMessageLoop() - instead manually call global function in Rust when message arrives. This is done in preparation for structured clone * refactor "WorkerChannel" and use distinct structs for internal and external channels; "WorkerChannelsInternal" and "WorkerHandle" * move "State.worker_channels_internal" to "Worker.internal_channels" * add "WorkerEvent" enum for child->host communication; currently "Message(Buf)" and "Error(ErrBox)" variants are supported * add tests for nested workers * add tests for worker throwing error on startup
This commit is contained in:
parent
81905a867e
commit
79b3bc05d6
26 changed files with 779 additions and 517 deletions
|
@ -30,7 +30,7 @@ impl CompilerWorker {
|
|||
let isolate = &mut worker.isolate;
|
||||
ops::runtime::init(isolate, &state);
|
||||
ops::compiler::init(isolate, &state);
|
||||
ops::web_worker::init(isolate, &state);
|
||||
ops::web_worker::init(isolate, &state, &worker.internal_channels.sender);
|
||||
ops::errors::init(isolate, &state);
|
||||
// for compatibility with Worker scope, though unused at
|
||||
// the moment
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue