e3408067cc
<!-- Before submitting a PR, please read http://deno.land/manual/contributing 1. Give the PR a descriptive title. Examples of good title: - fix(std/http): Fix race condition in server - docs(console): Update docstrings - feat(doc): Handle nested reexports Examples of bad title: - fix #7123 - update docs - fix bugs 2. Ensure there is a related issue and it is referenced in the PR text. 3. Ensure there are tests that cover the changes. 4. Ensure `cargo test` passes. 5. Ensure `./tools/format.js` passes without changing files. 6. Ensure `./tools/lint.js` passes. 7. Open as a draft PR if your work is still in progress. The CI won't run all steps, but you can add '[ci]' to a commit message to force it to. 8. If you would like to run the benchmarks on the CI, add the 'ci-bench' label. --> This commit replaces `pin_mut!` macro with `pin!` macro that has been provided from std since Rust 1.68.0. With the std version we can not only expect its stability but also pass an expression (rather than identifier) as an argument to the macro. |
||
---|---|---|
.. | ||
examples | ||
js | ||
ops | ||
permissions | ||
build.rs | ||
Cargo.toml | ||
colors.rs | ||
errors.rs | ||
fmt_errors.rs | ||
fs_util.rs | ||
inspector_server.rs | ||
js.rs | ||
lib.rs | ||
README.md | ||
tokio_util.rs | ||
web_worker.rs | ||
worker.rs | ||
worker_bootstrap.rs |
deno_runtime
crate
This is a slim version of the Deno CLI which removes typescript integration and various tooling (like lint and doc). Basically only JavaScript execution with Deno's operating system bindings (ops).
Stability
This crate is built using battle-tested modules that were originally in deno
crate, however the API of this crate is subject to rapid and breaking changes.
MainWorker
The main API of this crate is MainWorker
. MainWorker
is a structure
encapsulating deno_core::JsRuntime
with a set of ops used to implement Deno
namespace.
When creating a MainWorker
implementors must call MainWorker::bootstrap
to
prepare JS runtime for use.
MainWorker
is highly configurable and allows to customize many of the
runtime's properties:
- module loading implementation
- error formatting
- support for source maps
- support for V8 inspector and Chrome Devtools debugger
- HTTP client user agent, CA certificate
- random number generator seed
Worker
Web API
deno_runtime
comes with support for Worker
Web API. The Worker
API is
implemented using WebWorker
structure.
When creating a new instance of MainWorker
implementors must provide a
callback function that is used when creating a new instance of Worker
.
All WebWorker
instances are descendents of MainWorker
which is responsible
for setting up communication with child worker. Each WebWorker
spawns a new OS
thread that is dedicated solely to that worker.