Exidex
Exidex16mo ago

HandleScope in async op

Is there a way to get v8::HandleScope inside async op if I add it as
scope: &mut v8::HandleScope<'a>,
scope: &mut v8::HandleScope<'a>,
it errors with following error
195 | #[op]
| ^^^^^ the trait `Deserialize<'_>` is not implemented for `&mut HandleScope<'_>`
195 | #[op]
| ^^^^^ the trait `Deserialize<'_>` is not implemented for `&mut HandleScope<'_>`
1 Reply
Exidex
Exidex16mo ago
Looks like it is not currently possible but there is a possible workaround https://github.com/denoland/deno/issues/15375
GitHub
cannot receive HandleScope in #[op] when function is async. · I...
Hi! While we can get a scope when the #[op] is not async: #[op(v8)] fn op_my_op(scope: &mut deno_core::v8::HandleScope) { /* OK */ } we can't do the same with async functions: #[op(v8)] asy...