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
The local coroutine scheduler (#52) interacts with Dispatch by polling with zero or more calls. Another capability of poll is the ability to delay resumption of the coroutine(s) (using max_wait).
The scheduler could provide a sleep(duration) directive – alongside the existing call and gather directives – that puts a coroutine to sleep for the specified duration.
This could obviously be used to delay work. It could also be used with #88 to implement higher-level concurrency patterns. For example, await any(sleep(0), someOperation()) could be used to submit a fire-and-forget operation without blocking the coroutine, allowing it to continue on with additional work.
The text was updated successfully, but these errors were encountered:
The local coroutine scheduler (#52) interacts with Dispatch by polling with zero or more calls. Another capability of
poll
is the ability to delay resumption of the coroutine(s) (usingmax_wait
).The scheduler could provide a
sleep(duration)
directive – alongside the existingcall
andgather
directives – that puts a coroutine to sleep for the specified duration.This could obviously be used to delay work. It could also be used with #88 to implement higher-level concurrency patterns. For example,
await any(sleep(0), someOperation())
could be used to submit a fire-and-forget operation without blocking the coroutine, allowing it to continue on with additional work.The text was updated successfully, but these errors were encountered: