blocking_with
fn blocking_with<A, T>(A -> T work, A arg) -> Result<T, ThreadError> Import
Source: use task::{blocking_with}; compiler/src/prelude/task.hy Like blocking, passing arg to work (it is copied to the other thread, like thread::spawn(work, arg)).
Parameters#
| Name | Type |
|---|---|
work | A -> T |
arg | A |
Returns#
Result<T, ThreadError>
See also#
task::blockingscope: Runsbodywith aScopefor starting child tasks, and returns its value oncebodyand every child have finished.sleep: 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.block_on: Resumes the coroutinehandleuntil it is done and returns its completion value; values it yields are discarded.