Scope.GlobalAllows creating non-local scopes for performing unstructured concurrency.
val create :
'a. 'a @ portable ->
on_exit:
('a t -> ((Base.exn * Base.Backtrace.t) Base.or_null -> Base.unit) @ once) @ once portable ->
'a tcreate context ~on_exit creates a new global scope.
If a task within the scope raises an uncaught exception or the scope is explicitly terminated, the on_exit callback will be called with the exception that was raised (if any) and the scope itself. The exception is accessible via Scope.failure, but is passed to on_exit to push callers to think about uncaught exceptions.
val create_with_trigger :
'a. 'a @ portable ->
finished:Await_kernel.Trigger.Source.t ->
'a tcreate_with_trigger context ~finished creates a new scope. The trigger finished will be signaled after the scope has been terminated and all of the tasks added to it have exited. Note that this will only happen in case a task added to the scope exits with an uncaught exception or the terminator of the scope is explicitly terminated.