Module Scope.Task_handle

type 'a scope := 'a t
type 'a t

Represents a newly started task that either becomes a daemon or a regular task.

val into_scope : 'a t @ local unique -> 'a scope @ local

into_scope task_handle consumes the task handle and turns it into the scope the task was spawned into.

val become_daemon : 'a t @ local unique -> #('a scope * Await_kernel.Cancellation.t) @ local

become_daemon task_handle consumes the task handle, turns the task it represents into a daemon task, and returns the scope the daemon task was spawned into, along with a cancellation token that is canceled once all non-daemon tasks exit.