Guidance around imlementing callbacks with custom deno embedding #27504
-
Hey, so we're embedding deno in our program with extensions added and have need for a callback system. I.e. the typescript code registers a bunch of functions that are supposed to be invoked by the native section. Calling a simple function is simple enough but some of the callbacks are to be async so it needs to support waiting on a promise. We were able to find an example of how to get this done within the deno repositories, the TLDR: what is the recommended way to implement callbacks or await js promises from rust side with support for catching exceptions? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
There's no built-in mechanism for this right now. When a promise rejects, it goes through machinery in |
Beta Was this translation helpful? Give feedback.
There's no built-in mechanism for this right now. When a promise rejects, it goes through machinery in
deno_core
that allows the unhandled rejection to be handled by callbacks likeonunhandledrejection
orprocess.on("unhandledRejection")
.