summaryrefslogtreecommitdiff
path: root/core/examples
AgeCommit message (Collapse)Author
2021-03-19chores: enforce type ResourceId across codebase (#9837)Divy Srivastava
2021-02-13refactor(core): Strongly typed deserialization of JSON ops (#9423)Jared Beller
This PR makes json_op_sync/async generic to all Deserialize/Serialize types instead of the loosely-typed serde_json::Value. Since serde_json::Value implements Deserialize/Serialize, very little existing code needs to be updated, however as json_op_sync/async are now generic, type inference is broken in some cases (see cli/build.rs:146). I've found this reduces a good bit of boilerplate, as seen in the updated deno_core examples. This change may also reduce serialization and deserialization overhead as serde has a better idea of what types it is working with. I am currently working on benchmarks to confirm this and I will update this PR with my findings.
2021-01-10update copyright to 2021 (#9081)Ryan Dahl
2020-12-22core: fix http_bench_json_ops, register Error (#8860)Ben Noordhuis
Fixes the following runtime error for me when benchmarking: thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error: Unregistered error class: "Error" Connection reset by peer (os error 104) Classes of errors returned from ops should be registered via Deno.core.registerErrorClass(). at processResponse (deno:core/core.js:219:13) at Object.jsonOpAsync (deno:core/core.js:240:12) at async read (http_bench_json_ops.js:29:21) at async serve (http_bench_json_ops.js:45:19)', core/examples/http_bench_json_ops.rs:260:28
2020-12-16refactor: rewrite ops to use ResourceTable2 (#8512)Bartek Iwańczuk
This commit migrates all ops to use new resource table and "AsyncRefCell". Old implementation of resource table was completely removed and all code referencing it was updated to use new system.
2020-12-09core: add plumbing for canceling ops when closing a resource (#8661)Bert Belder
2020-11-25core: implement 'AsyncRefCell' and 'ResourceTable2' (#8273)Bert Belder
2020-10-11reland JsRuntime/Worker is not a Future (#7924)Bartek Iwańczuk
2020-10-10Fix 100% CPU idling problem by reverting #7672 (#7911)Ryan Dahl
* Revert "refactor: Worker is not a Future (#7895)" This reverts commit f4357f0ff9d39411f22504fcc20db6bd5dec6ddb. * Revert "refactor(core): JsRuntime is not a Future (#7855)" This reverts commit d8879feb8c832dbb38649551b1cb0730874f7be6. * Revert "fix(core): module execution with top level await (#7672)" This reverts commit c7c767782538243ded64742dca9b34d6af74d62d.
2020-10-07refactor(core): JsRuntime is not a Future (#7855)Bartek Iwańczuk
This commit rewrites deno_core::JsRuntime to not implement Future trait. Instead there are two separate methods: - JsRuntime::poll_event_loop() - does single tick of event loop - JsRuntime::run_event_loop() - runs event loop to completion
2020-10-07refactor: rename isolate to js_runtime (#7858)Bartek Iwańczuk
This commit renames occurrences of "isolate" variable name to "js_runtime". This was outstanding debt after renaming deno_core::CoreIsolate to JsRuntime.
2020-09-23Add example for deno_core (#7611)Valentin Anger
2020-09-22refactor(core): support error stack, remove js_check (#7629)Bartek Iwańczuk
This commit adds support for stack traces in "deno_core". Implementation of "Display" trait for "JsError" has been updated and in consequence "deno_core::js_check" became obsolete and removed.
2020-09-21chore: add copyright (#7593)tokiedokie
2020-09-15refactor: use the 'anyhow' crate instead of 'ErrBox' (#7476)Bert Belder
2020-09-11refactor(core): JsRuntime initialization (#7415)Bartek Iwańczuk
Removes: - "deno_core::StartupData" - "deno_core::Script" - "deno_core::OwnedScript" Changes to "JsRuntime": - remove "new_with_loader()" - remove "with_heap_limits()" - rename "IsolateOptions" to "RuntimeOptions" and make public - "JsRuntime::new()" takes "RuntimeOptions" as a single param
2020-09-10Use gotham-like state for ops (#7385)Ryan Dahl
Provides a concrete state type that can be dynamically added. This is necessary for op crates. * renames BasicState to OpState * async ops take `Rc<RefCell<OpState>>` * sync ops take `&mut OpState` * removes `OpRegistry`, `OpRouter` traits * `get_error_class_fn` moved to OpState * ResourceTable moved to OpState
2020-09-06refactor(core): rename CoreIsolate to JsRuntime (#7373)Bartek Iwańczuk
deno_core/ - rename core_isolate.rs to runtime.rs - rename CoreIsolate to JsRuntime - rename JSError to JsError - rename JSStackFrame to JsStackFrame cli/ - update references from deno_core::CoreIsolate to deno_core::JsRuntime - rename deno_core::JSError to deno_core::JsError - rename fmt_errors::JSError to fmt_errors::JsError
2020-09-06Move JSON ops to deno_core (#7336)Bert Belder
2020-08-21Split core http benchmark into 'bin_ops' and 'json_ops' variants (#7147)Bert Belder
2020-08-21Convert the remaining http_bench ops to json ops (#7143)Bert Belder
2020-08-20First pass at json ops in core (#7033)Ryan Dahl
Adds Deno.core.jsonOpSync and Deno.core.jsonOpAsync
2020-08-17Simplify deno_core_http_bench op state (#7038)Ryan Dahl
Removes unnecessary wrappers around ResourceTable and CoreIsolate. Importantly: now uses the resource table inside CoreIsolateState rather than a different one. Removes derive_deref dependency
2020-07-14Use dprint for internal formatting (#6682)David Sherret
2020-07-08BREAKING(core): Remove control slice from ops (#6048)Valentin Anger
2020-06-01feat(core): Ops can take several zero copy buffers (#4788)Valentin Anger
2020-05-29refactor: Split isolate and state using safe get_slot() (#5929)Ryan Dahl
2020-04-23Rename deno_core::Isolate to deno_core::CoreIsolate (#4851)Ryan Dahl
2020-04-19Modify op dispatcher to include &mut Isolate argument (#4821)Ryan Dahl
- Removes unnecessary RwLock and Rc around the op registry table - Preparation to move resource_table to deno_core::Isolate. - Towards #3453, #4222
2020-04-18Fix Op definitions (#4814)Ryan Dahl
2020-03-28Update to Prettier 2 and use ES Private Fields (#4498)Kitson Kelly
2020-03-20Remove DENO_BUILD_MODE and DENO_BUILD_PATH (#4431)Ryan Dahl
* Remove DENO_BUILD_MODE and DENO_BUILD_PATH Also remove outdated docs related to ninja/gn. * fix * remove parameter to build_mode() * remove arg parsing from benchmark.py
2020-03-20Add require-await lint rule (#4401)Samrith Shankar
2020-03-16refactor: add no-return-await lint rule (#4384)Bartek Iwańczuk
2020-02-07Refactor deno_core_http_bench and make it single-threaded (#3903)Bert Belder
2020-02-03refactor: Use Tokio's single-threaded runtime (#3844)Ryan Dahl
This change simplifies how we execute V8. Previously V8 Isolates jumped around threads every time they were woken up. This was overly complex and potentially hurting performance in a myriad ways. Now isolates run on their own dedicated thread and never move. - blocking_json spawns a thread and does not use a thread pool - op_host_poll_worker and op_host_resume_worker are non-operational - removes Worker::get_message and Worker::post_message - ThreadSafeState::workers table contains WorkerChannel entries instead of actual Worker instances. - MainWorker and CompilerWorker are no longer Futures. - The multi-threaded version of deno_core_http_bench was removed. - AyncOps no longer need to be Send + Sync This PR is very large and several tests were disabled to speed integration: - installer_test_local_module_run - installer_test_remote_module_run - _015_duplicate_parallel_import - _026_workers
2020-01-24s/PinnedBuf/ZeroCopyBuf (#3782)Ryan Dahl
2020-01-17fix deno_core_http_bench (#3698)Bartek Iwańczuk
2020-01-17feat: support individual async handler for each op (#3690)Andy Finch
2020-01-11refactor: remove Isolate.current_send_cb_info and DenoBuf, port ↵Bartek Iwańczuk
Isolate.shared_response_buf (#3643) * remove Isolate.current_send_cb_info * remove DenoBuf * remove Isolate.shared_ab * port Isolate.shared_response_buf (last bit not ported from libdeno) * add some docs for Isolate and EsIsolate
2020-01-05Rename crates: 'deno' to 'deno_core' and 'deno_cli' to 'deno' (#3600)Ry Dahl
2019-12-23Upgrades rust to 1.40.0 (#3542)Axetroy
2019-12-15upgrade: tokio 0.2 in deno_core_http_bench, take2 (#3435)Bartek Iwańczuk
2019-11-27Revert "update deno_core_http_bench to Tokio 0.2 (#3408)" Ry Dahl
It seems this has caused CI to go red for an unknown reason. This reverts commit 866dba8aa116677143a354af7f3271e4f9c417e1.
2019-11-26update deno_core_http_bench to Tokio 0.2 (#3408)Bartek Iwańczuk
2019-11-18feat: op registration during calls (#3375)Andy Finch
2019-11-17fix deno_core_http_bench (#3364)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-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.