Function in task compiler

blocking_with

fn blocking_with<A, T>(A -> T work, A arg) -> Result<T, ThreadError>
Import
use task::{blocking_with};
Source: compiler/src/prelude/task.hy

Like blocking, passing arg to work (it is copied to the other thread, like thread::spawn(work, arg)).

Parameters#

NameType
workA -> T
argA

Returns#

Result<T, ThreadError>

See also#

  • task::blocking
  • scope: Runs body with a Scope for starting child tasks, and returns its value once body and every child have finished.
  • sleep: Suspends the current task for at least ms milliseconds; other tasks run meanwhile.
  • yield_now: Lets other ready tasks run before the current one continues.
  • timeout: Runs body as a task and cancels it if it has not finished after ms milliseconds.
  • shield: Runs body so that a cancel waits for it to finish instead of interrupting it.
  • channel: Creates a channel that holds up to capacity values.
  • block_on: Resumes the coroutine handle until it is done and returns its completion value; values it yields are discarded.
↑ ↓ navigate ↵ open