Stream: wasi

Topic: Poll and ready() for subscribe_duration


view this post on Zulip Ashanti Mutinta (Mar 06 2024 at 18:12):

Hello everyone, had some questions about preview 2. I was wondering if we call ready() on the subscribe_duration pollable can it still resolve? Issue I'm coming into is that poll is blocking my event loop until its "ready".

view this post on Zulip Dan Gohman (Mar 06 2024 at 18:17):

Calling ready doesn't do anything to cause a pollable to resolve; it just reports whether the pollable has happened to resolve already.

view this post on Zulip Ashanti Mutinta (Mar 06 2024 at 18:19):

Dan Gohman said:

Calling ready doesn't do anything to cause a pollable to resolve; it just reports whether the pollable has happened to resolve already.

So I guess it's mostly used in conjunction with the poll method?

view this post on Zulip Dan Gohman (Mar 06 2024 at 18:21):

Yeah. See for example https://github.com/yoshuawuyts/wasm-http-tools/blob/main/crates/wasi-async-runtime, which is an implementation of a Rust async runtime that uses poll and ready.

view this post on Zulip Ashanti Mutinta (Mar 06 2024 at 18:22):

Oh yes I have been going through this. Okay that is awesome ty!


Last updated: Dec 23 2024 at 13:07 UTC