diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-02-18 14:47:11 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-18 14:47:11 -0500 |
commit | 3d5bed35e032ee20e4fe34cad925202c6f0c0d3e (patch) | |
tree | 2f9ad905c9e55bd80832055ac7ef41c94bf419bc /cli/compilers/ts.rs | |
parent | 08dcf6bff73bbe579769ccd0f135ed4af919ea48 (diff) |
refactor: remove run_worker_loop (#4028)
* remove run_worker_loop, impl poll for WebWorker
* store JoinHandle to worker thread
Diffstat (limited to 'cli/compilers/ts.rs')
-rw-r--r-- | cli/compilers/ts.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/cli/compilers/ts.rs b/cli/compilers/ts.rs index 9bfd93eeb..dec74c256 100644 --- a/cli/compilers/ts.rs +++ b/cli/compilers/ts.rs @@ -9,12 +9,11 @@ use crate::file_fetcher::SourceFile; use crate::file_fetcher::SourceFileFetcher; use crate::global_state::GlobalState; use crate::msg; -use crate::ops::worker_host::run_worker_loop; use crate::ops::JsonResult; use crate::source_maps::SourceMapGetter; use crate::startup_data; use crate::state::*; -use crate::tokio_util::create_basic_runtime; +use crate::tokio_util; use crate::version; use crate::worker::WorkerEvent; use crate::worker::WorkerHandle; @@ -611,11 +610,10 @@ async fn execute_in_thread( let builder = std::thread::Builder::new().name("deno-ts-compiler".to_string()); let join_handle = builder.spawn(move || { - let mut worker = TsCompiler::setup_worker(global_state.clone()); + let worker = TsCompiler::setup_worker(global_state.clone()); handle_sender.send(Ok(worker.thread_safe_handle())).unwrap(); drop(handle_sender); - let mut rt = create_basic_runtime(); - run_worker_loop(&mut rt, &mut worker).expect("Panic in event loop"); + tokio_util::run_basic(worker).expect("Panic in event loop"); })?; let mut handle = handle_receiver.recv().unwrap()?; handle.post_message(req).await?; |