SingleForegroundJobRegistry
A ForegroundJobRegistry that allows to register only one Job at once. Repeated call to a register without a consumeOrNull results in an exception.
Constructors
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
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.