summaryrefslogtreecommitdiff
path: root/cli/worker.rs
AgeCommit message (Collapse)Author
2020-02-02Remove //tests symlink (#3849)Luka Hartwig
2020-01-27refactor: isomorphic snapshot for CLI (#3728)Bartek Iwańczuk
2020-01-25Refactor error tracking and scope juggling in deno_core (#3783)Bert Belder
2020-01-24Add signal handlers (#3757)Yoshiya Hinosawa
2020-01-21refactor: split cli::Worker (#3735)Bartek Iwańczuk
* cli::Worker is base struct to create specialized workers * add MainWorker * add CompilerWorker * refactor WebWorker to use Worker
2020-01-21refactor: Rename JS entry functions (#3732)Bartek Iwańczuk
2020-01-21refactor: split worker and worker host logic (#3722)Bartek Iwańczuk
* split ops/worker.rs into ops/worker_host.rs and ops/web_worker.rs * refactor js/workers.ts and factor out js/worker_main.ts - entry point for WebWorker runtime * BREAKING CHANGE: remove support for blob: URL in Worker * BREAKING CHANGE: remove Deno namespace support and noDenoNamespace option in Worker constructor * introduce WebWorker struct which is a stripped down version of cli::Worker
2020-01-17workers: minimal error handling and async module loading (#3665)Bartek Iwańczuk
2020-01-08refactor: module loading in EsIsolate (#3615)Bartek Iwańczuk
* refactored RecursiveLoad - it was renamed to RecursiveModuleLoad, it does not take ownership of isolate anymore - a struct implementing Stream that yields SourceCodeInfo * untangled module loading logic between RecursiveLoad and isolate - that logic is encapsulated in EsIsolate and RecursiveModuleLoad, where isolate just consumes modules as they become available - does not require to pass Arc<Mutex<Isolate>> around anymore * removed EsIsolate.mods_ in favor of Modules and moved them inside EsIsolate * EsIsolate now requires "loader" argument during construction - struct that implements Loader trait * rewrite first methods on isolate as async
2020-01-07core: factor out EsIsolate from Isolate (#3613)Bartek Iwańczuk
2020-01-06merge libdeno::DenoIsolate into core::Isolate (#3605)Bartek Iwańczuk
2020-01-05Rename crates: 'deno' to 'deno_core' and 'deno_cli' to 'deno' (#3600)Ry Dahl
2020-01-04Use async at places, use &self instead of self: &Self (#3594)Gurwinder Singh
2020-01-02Happy new year! (#3578)Ry Dahl
2020-01-01cleanup after tokio upgrade (#3571)Gurwinder Singh
tokio_util::run and tokio::run_on_current_thread should accept Future<Output=()> instead of Future<Output=Result<(), ()>>. Currently, all the passed futures have to add Ok(()) or futures::future::ok(()) unnecessarily to call this method.
2019-12-30upgrade: Tokio 0.2 (#3418)Bartek Iwańczuk
2019-12-23Upgrades rust to 1.40.0 (#3542)Axetroy
2019-12-20repl: do not crash on async op reject (#3527)Kevin (Kun) "Kassimo" Qian
2019-12-05feat: first pass at native plugins (#3372)Andy Finch
2019-12-03remove duplicated argv member from ThreadSafeGlobalState (#3433)Ry Dahl
2019-11-24refactor: Elevate DenoPermissions lock to top level (#3398)Kevin (Kun) "Kassimo" Qian
2019-11-22remove tokio_util::block_on (#3388)Bartek Iwańczuk
This PR removes tokio_util::block_on - refactored compiler and file fetcher slightly so that we can safely block there - that's because only blocking path consist of only synchronous operations. Additionally I removed excessive use of tokio_util::panic_on_error and tokio_util::run_in_task and moved both functions to cli/worker.rs, to tests module. Closes #2960
2019-11-22minor clean ups in TS compiler (#3394)Bartek Iwańczuk
2019-11-19remove tokio_util::block_on from ops/workers.rs (#3381)Bartek Iwańczuk
2019-11-17refactor: fixes for futures (#3363)Bartek Iwańczuk
After landing #3358 the benchmarks exploded indicating problems with workers and deno_core_http_bench. This PR dramatically fixes thread/syscall count that showed up on benchmarks. Thread count is not back to previous levels but difference went from hundreds/thousands to about ~50.
2019-11-16Use futures 0.3 API (#3358)Bartek Iwańczuk
2019-11-09refactor: worker is no longer a resource (#3290)Bartek Iwańczuk
2019-11-07refactor: remove cli::resources::Resource (#3285)Bartek Iwańczuk
2019-11-06Remove CoreResource::inspect_repr method (#3274)Ry Dahl
Towards simplifying (or better removing entirely) the CoreResource trait. Resources should be any bit of privileged heap allocated memory that needs to be referenced from JS, not very specific trait implementations. Therefore CoreResource should be pushed towards being as general as possible.
2019-11-04Refactor Worker and ThreadSafeState (#3242)Bartek Iwańczuk
* 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
2019-10-28refactor: use core ResourceTable in cli (#3206)Bartek Iwańczuk
2019-10-19feat: Allow "deno eval" to run code as module (#3148)Kevin (Kun) "Kassimo" Qian
2019-10-14perf: eager poll async ops in Isolate (#3046)Bartek Iwańczuk
2019-10-13fix: [tls] op_dial_tls is not registerd and broken (#3121)Yusuke Sakurai
2019-10-11Add init methods for each op module (#3087)Ryan Dahl
2019-10-06remove more calls to tokio_util::block_on (#3059)Bartek Iwańczuk
towards #2960
2019-10-02feat: Add support for passing a key to Deno.env() (#2952)Jed Fox
This adds a new op to get a single env var.
2019-10-01use Isolate::register_op in deno_cli (#3039)Bartek Iwańczuk
2019-09-19Remove test.py, use cargo test as test frontend (#2967)Ryan Dahl
Fixes #2933
2019-09-04Run tests after "cargo build" on travis (#2854)Ryan Dahl
2019-08-21Organize dispatch a bit (#2796)Ryan Dahl
Just some clean up reorganization around flatbuffer/minimal dispatch code. This is prep for adding a JSON dispatcher.
2019-08-09Fix dynamic import base path problem for REPL and eval (#2757)Kevin (Kun) "Kassimo" Qian
2019-08-09Dynamic import (#2516)Bert Belder
2019-08-07Add op_id throughout op API (#2734)Ryan Dahl
Removes the magic number hack to switch between flatbuffers and the minimal dispatcher. Adds machinery to pass the op_id through the shared_queue.
2019-08-05Provide option to delete Deno namespace in worker (#2717)Kevin (Kun) "Kassimo" Qian
2019-07-31Use system rustfmt instead of fixed binary (#2701)Ryan Dahl
2019-07-31factor out FileFetcher to separate module (#2683)Bartek Iwańczuk
* merge SourceFileFetcher trait and FileFetcher struct * move logic related to source file fetching to //cli/file_fetcher.rs * use Result when creating new ThreadSafeState
2019-07-17Refactor DenoDir (#2636)Bartek Iwańczuk
* rename `ModuleMetaData` to `SourceFile` and remove TS specific functionality * add `TsCompiler` struct encapsulating processing of TypeScript files * move `SourceMapGetter` trait implementation to `//cli/compiler.rs` * add low-level `DiskCache` API for general purpose caches and use it in `DenoDir` and `TsCompiler` for filesystem access * don't use hash-like filenames for compiled modules, instead use metadata file for storing compilation hash * add `SourceFileCache` for in-process caching of loaded files for fast subsequent access * define `SourceFileFetcher` trait encapsulating loading of local and remote files and implement it for `DenoDir` * define `use_cache` and `no_fetch` flags on `DenoDir` instead of using in fetch methods
2019-07-11Refactor error to use dynamic dispatch and traitsBert Belder
This is in preperation for dynamic import (#1789), which is more easily implemented when errors are dynamic.
2019-07-08core: clearly define when module lookup is path-based vs URL-basedBert Belder
The rules are now as follows: * In `import` statements, as mandated by the WHATWG specification, the import specifier is always treated as a URL. If it is a relative URL, it must start with either / or ./ or ../ * A script name passed to deno as a command line argument may be either an absolute URL or a local path. - If the name starts with a valid URI scheme followed by a colon, e.g. 'http:', 'https:', 'file:', 'foo+bar:', it always interpreted as a URL (even if Deno doesn't support the indicated protocol). - Otherwise, the script name is interpreted as a local path. The local path may be relative, and operating system semantics determine how it is resolved. Prefixing a relative path with ./ is not required.