mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 04:39:10 +00:00
chore(core): update deno_core README (#14042)
Co-authored-by: Andreu Botella <andreu@andreubotella.com>
This commit is contained in:
parent
7c2722201e
commit
5e82bcf0e4
1 changed files with 4 additions and 4 deletions
|
@ -16,10 +16,10 @@ keeps track of all pending tasks (async ops, dynamic module loads). It is user's
|
||||||
responsibility to drive that loop by using `JsRuntime::run_event_loop` method -
|
responsibility to drive that loop by using `JsRuntime::run_event_loop` method -
|
||||||
it must be executed in the context of Rust's future executor (eg. tokio, smol).
|
it must be executed in the context of Rust's future executor (eg. tokio, smol).
|
||||||
|
|
||||||
In order to bind Rust functions into JavaScript, use the `Deno.core.opSync()`
|
Rust functions can be registered in JavaScript using `deno_core::Extension`. Use
|
||||||
and `Deno.core.opAsync()` functions to trigger the "op_fn" callback in
|
the `Deno.core.opSync()` and `Deno.core.opAsync()` functions to trigger the op
|
||||||
`JsRuntime::register_op` on Rust side. A conventional way to handle "op_fn"
|
function callback. A conventional way to write ops is using the
|
||||||
callbacks is to use the `op_sync` and `op_async` functions.
|
[`deno_ops`](https://github.com/denoland/deno/blob/main/ops) crate.
|
||||||
|
|
||||||
Documentation for this crate is thin at the moment. Please see
|
Documentation for this crate is thin at the moment. Please see
|
||||||
[hello_world.rs](https://github.com/denoland/deno/blob/main/core/examples/hello_world.rs)
|
[hello_world.rs](https://github.com/denoland/deno/blob/main/core/examples/hello_world.rs)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue