-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interruptible timeout in wasm #8687
Comments
If you're the host then you can use Wasmtime's async support in conjunction with epochs or fuel to interrupt WebAssembly that's currently executing. If you're the guest then the main way to block right now is through the "poll"-style interfaces which have a timeout parameter. You'll need to coordinate within the guest to ensure that this timeout is configured accordingly. |
Could you explain more please ? If you can provide some documentations and demo github examples that will be great . I was expecting on guest side interrupt but I saw here - https://github.com/dicej/component-async-demo that @dicej has been using his local fork of wasmtime and other wasm tools (wit-bindgen , wasm-tools , wasmtime-wasi) . So I thought may be the async thing is not ready and not available right now . Also I am using right now 19 version of wasmtime and related tools (wasmtime-wasi , wasm-tools and so on) although I can try upgrading it to latest version if needed |
Implementing a cancellable timeout should be doable with WASI 0.2 using The main question to answer is: what event(s) should trigger cancellation? That will determine what kind of |
I believe the question here has been answered so I'm going to close, but feel free to comment and/or open a new issue with other questions. |
I want to wait / sleep or run a function after timeout of some seconds in wasm32-wasi component ? But I want that to be cancellable .
I tried doing this - https://stackoverflow.com/a/70121550 But I got error - failed to spawn thread: Error { kind: Unsupported, message: "operation not supported on this platform" } on spawning thread , I have tried compiling my rust to wasm32-wasip1-threads and on host I have make sure to enable wasm_threads support by config.wasm_threads(true).
What else do I need to do ?
The text was updated successfully, but these errors were encountered: