Small task helpers shared by the runtime and transport layers.
Summary
Functions
Starts an unlinked task under the default task supervisor.
Starts an unlinked task under a specific task supervisor.
Awaits a task result using the Task.yield || Task.shutdown pattern.
Starts a child task under the default task supervisor.
Starts a child task under a specific task supervisor.
Types
@type task_start_error() :: :noproc | {:runtime_not_started, :execution_plane_process} | {:task_start_failed, term()}
Functions
@spec async_nolink((-> any())) :: {:ok, Task.t()} | {:error, task_start_error()}
Starts an unlinked task under the default task supervisor.
@spec async_nolink(pid() | atom(), (-> any())) :: {:ok, Task.t()} | {:error, task_start_error()}
Starts an unlinked task under a specific task supervisor.
@spec await(Task.t(), timeout(), :brutal_kill | :shutdown) :: {:ok, term()} | {:exit, term()} | {:error, :timeout}
Awaits a task result using the Task.yield || Task.shutdown pattern.
@spec start_child((-> any())) :: {:ok, pid()} | {:error, task_start_error()}
Starts a child task under the default task supervisor.
@spec start_child(pid() | atom(), (-> any())) :: {:ok, pid()} | {:error, task_start_error()}
Starts a child task under a specific task supervisor.