Skip to main content

adopt

Function adopt 

Source
pub fn adopt(
    state: &RunState,
    parent_task: Option<&str>,
) -> Result<Option<Adopted>>
Expand description

Give a run this process is about to execute an owning task. A parent task that exists and is queued, failed or held is claimed, started with the run and settled by Adopted::finish exactly like an ownerless run’s; if somebody else holds its claim, or the task is Done, blocked or running, the run is only linked and nothing is settled. With no such parent, a task is filed and claimed for the duration. Ok(None) when no magi home is pinned, or when the run was only linked to its parent. An error means the run has no owner and must not be executed: filing or claiming the new task failed.