refactor: worker is no longer a resource (#3290)

This commit is contained in:
Bartek Iwańczuk 2019-11-09 21:07:14 +01:00 committed by Bert Belder
parent d586f119fa
commit 335e8bd33c
7 changed files with 153 additions and 142 deletions

View file

@ -223,8 +223,10 @@ impl TsCompiler {
/// Create a new V8 worker with snapshot of TS compiler and setup compiler's runtime.
fn setup_worker(global_state: ThreadSafeGlobalState) -> Worker {
let worker_state = ThreadSafeState::new(global_state.clone(), None, true)
.expect("Unable to create worker state");
let (int, ext) = ThreadSafeState::create_channels();
let worker_state =
ThreadSafeState::new(global_state.clone(), None, true, int)
.expect("Unable to create worker state");
// Count how many times we start the compiler worker.
global_state
@ -236,6 +238,7 @@ impl TsCompiler {
"TS".to_string(),
startup_data::compiler_isolate_init(),
worker_state,
ext,
);
worker.execute("denoMain()").unwrap();
worker.execute("workerMain()").unwrap();