deno_core icon indicating copy to clipboard operation
deno_core copied to clipboard

Run runtime async?

Open Jak2k opened this issue 2 years ago • 4 comments

I'm currently making my own little js-environment based on deno-core. My goal is to let the user modify the UI from the JS. When I use the code from the examples, the runtime is executed blocking. Ho can I change that? Could you add an example?

Jak2k avatar Sep 02 '23 17:09 Jak2k

Could you explain a bit more what you are trying to achieve? JsRuntime is meant to be used from async contexts and all examples do that. In Rust when you have some async operations going on they need to "block" at least at the top level and that's what the examples are showcasing.

bartlomieju avatar Sep 03 '23 19:09 bartlomieju

I want to run a Gtk4-app and a JS-Runtime at the same time. It is possible to run the JS-Runtime not blocking and then run the GTK-app blocking?

Jak2k avatar Sep 04 '23 04:09 Jak2k

To be honest, I'm not sure - do you use Tokio in your app?

bartlomieju avatar Sep 04 '23 13:09 bartlomieju

I'm doing the same as in this example.

Jak2k avatar Sep 04 '23 17:09 Jak2k