Package-level declarations
Types
ForegroundJobRegistry that ignores interactions and returns a completed Job on consume.
Provides LocalClosureContainer that ignores local changes and returns closure.
Default CoroutineScope associated with a store. By default, the store contains a MainScope and it can be replaced at store creation by adding it into a DispatchClosure. It can be accessed by coroutineScope extension property. Tools provided by this library most likely use this scope to launch a coroutine.
A ForegroundJobRegistry that ignores registered job and always fails on consume. It's injected by default into the store's closure.
Marker interface for every Action that has a foreground job (kotlinx.coroutines.Job) logically associated with it.This kind of action must result in a single coroutine being launched by a middleware using launchForeground. Handle to this coroutine is returned by dispatchJob or it might be simply joined using joinDispatchJob. CoroutineScope depends on method used to dispatch it.
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.
A ForegroundJobRegistry that allows to register only one Job at once. Repeated call to a register without a consumeOrNull results in an exception.
Functions
Dispatches action and expects any middleware to launch a single foreground job logically associate with it. Coroutine is launched in a scope provided by DispatchCoroutineScope.
Dispatches action and expects any middleware to launch a single foreground job logically associate with it. This function suspends until foreground job is finished. When coroutine that calls this function is cancelled, foreground job is also cancelled.
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.
Launches a foreground job using closure form this scope. 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.
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.
Returns a DispatchClosure that enables foreground coroutines mechanism.
Creates a DispatchClosure that skips coroutines mechanism. Every dispatchJob is executed with no failure and returns completed job.
Runs given block as a coroutine in DispatchScope.coroutineScope. Effectively it ensures that any operation on a DispatchScope inside a block runs on proper thread.