Refactor Worker and ThreadSafeState (#3242)

* Split ThreadSafeState into State and GlobalState. State is a "local"
  state belonging to "Worker" while "GlobalState" is state shared by
  whole program.
* Update "Worker" and ops to use "GlobalState" where applicable
* Move and refactor "WorkerChannels" resource
This commit is contained in:
Bartek Iwańczuk 2019-11-04 16:38:52 +01:00 committed by Ry Dahl
parent 429439d198
commit 0049d4e50c
16 changed files with 557 additions and 414 deletions

View file

@ -2,7 +2,6 @@
use crate::compilers::CompiledModule;
use crate::compilers::CompiledModuleFuture;
use crate::file_fetcher::SourceFile;
use crate::state::ThreadSafeState;
use deno::ErrBox;
use regex::Regex;
use std::str;
@ -15,7 +14,6 @@ pub struct JsonCompiler {}
impl JsonCompiler {
pub fn compile_async(
self: &Self,
_state: ThreadSafeState,
source_file: &SourceFile,
) -> Box<CompiledModuleFuture> {
let maybe_json_value: serde_json::Result<serde_json::Value> =