block_on
fn block_on<Y>(coroutine<Y> handle) -> Y Import
Source: use task::{block_on}; compiler/src/prelude/task.hy Resumes the coroutine handle until it is done and returns its completion value; values it yields are discarded.
Deprecated: call the work directly, or run concurrent work as tasks with scope.
Parameters#
| Name | Type |
|---|---|
handle | coroutine<Y> |
Returns#
Y
See also#
task::scopesleep: Suspends the current task for at leastmsmilliseconds; other tasks run meanwhile.yield_now: Lets other ready tasks run before the current one continues.timeout: Runsbodyas a task and cancels it if it has not finished aftermsmilliseconds.shield: Runsbodyso that a cancel waits for it to finish instead of interrupting it.channel: Creates a channel that holds up tocapacityvalues.blocking: Runsworkon another OS thread and waits for its result; only the current task waits, the others keep running.blocking_with: Likeblocking, passingargtowork(it is copied to the other thread, likethread::spawn(work, arg)).