Skip to main content

Mojo function

create_raising_task

create_raising_task[type: Movable, origins: OriginSet](var handle: RaisingCoroutine[type, origins], out task: RaisingTask[type, origins])

Run a raising coroutine as a task on the AsyncRT Runtime.

Creates a task from a raising coroutine and schedules it for execution. The task may raise an error when waited on, propagating any error from the coroutine.

Parameters:

  • โ€‹type (Movable): The result type, which must be Movable to extract the result.
  • โ€‹origins (OriginSet): The origin set from the coroutine's captures.

Args:

  • โ€‹handle (RaisingCoroutine): The raising coroutine to execute as a task. Ownership is transferred.

Returns:

RaisingTask: The task output parameter is initialized with the created task.

Was this page helpful?