erksch
RustyV8: Example of using PromiseResolver / async?
Is there an example using PromiseResolver? Because it uses a HandleScope, I'm unsure about how to reference it at a later point when async work has been done.
Could you provide an example of implementing a async simple sleep function, ideally by pushing an async task to the main Tokio runtime?
Problem:
From JS:
await doRustAsync(5000);
Calling RS:
This Rust code obviously doesn't work, since:
1. the tokio runtime handle isn't available to the thread.
2. the promise/resolver uses scope, which is borrowed.16 replies