You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
stackful is a library which exposes primitives to construct stackful coroutines and make them interop easily with an external async runtime. We could either try to use it directly, or construct a similar abstraction of our own. The gist of it is that we want to be able to do this:
// `eval` returns a future which is awaited
vm.eval("sleep(1)").await;// inside, the execution of the VM is wrapped in `stackful`:stackful(|| {
vm.enter_dispatch_loop();});// at some point, `sleep` is called:asyncfnsleep(scope:Scope<'_>){
tokio::time::sleep(1).await;}// which would normally cause the VM to yield all the way back up to// the initial `eval`, but instead, the execution of the native async// function is wrapped in a `wait` from `stackful`:implNativeAsyncFunction{fncall(&self,args:Args) -> Result<Value>{wait(self(args))}}
The text was updated successfully, but these errors were encountered:
stackful
is a library which exposes primitives to construct stackful coroutines and make them interop easily with an external async runtime. We could either try to use it directly, or construct a similar abstraction of our own. The gist of it is that we want to be able to do this:The text was updated successfully, but these errors were encountered: