ForegroundJobRegistry
Allows to register a foreground job. It is responsible for passing Job reference outside the store, so it can be awaited or cancelled. By default, the store contains EmptyForegroundJobRegistry inside its closure. Functions like dispatchJob use local closure mechanism to replace it with SingleForegroundJobRegistry. launchForeground directly refers to local ForegroundJobRegistry.
Types
Functions
Returns registered foreground job or null.
Returns Element associated with the key or throws MissingClosureElementException.
Returns a closure without the element with a given key
Returns elements form this DispatchClosure as a Map.
Properties
Inheritors
Extensions
Launches a foreground job using this closure. By default, it's launched in a scope provided by DispatchCoroutineScope. This behaviour might be changed by dispatchJobIn or joinDispatchJob. Because this function uses local closure, calling it outside dispatch should not be done, because it might result in unexpected behaviour.
Returns this closure with local changes.
Runs block that must register a foreground job. It adds SingleForegroundJobRegistry to local closure to allow proper job registration. Local closure change creates a new frame if newFrame is true.
Changes LocalClosureContainer with a given closure for a time of block execution.