PipelineContext
PipelineContext is an entity that exposes the underlying logic of the Store to its StorePlugins.
Context is an implementation of the following:
CoroutineScope
Pipeline context is built based on the parent CoroutineScope and depends on it. Pipeline context is a child of the CoroutineContext of the store (scope). The pipeline's context is always the context the store was started with.
Types
A key of the PipelineContext in the parent coroutine context.
Properties
The StoreConfiguration of this store
Obtain the current value of state in an unsafe manner. It is recommended to always use withState or updateState as obtaining this value can lead to data races when the state transaction changes the value of the state previously obtained.
Functions
Send a new side-effect to be processed by subscribers, only once. How actions will be distributed and handled depends on ActionShareBehavior. Actions that make the capacity overflow may be dropped or the function may suspend until the buffer is freed.
Alias for ActionReceiver.action for multiple actions
An alias for Flow.collect that does not override the context, amending it instead. Use as a safer alternative to Flow.flowOn and then Flow.collect
Alias for intent with one difference - this function will suspend if pro.respawn.flowmvi.dsl.StoreBuilder.onOverflow permits it.
Alias for ActionReceiver.action
Alias for ActionReceiver.action for multiple actions
Alias for IntentReceiver.emit for multiple intents
Send an intent asynchronously. The intent is sent to the receiver and is placed in a queue. When IntentReceiver is available (e.g. when the Store is started), the intent will be processed. Intents that overflow the buffer will be handled according to the behavior specified in pro.respawn.flowmvi.dsl.StoreBuilder.onOverflow. If the store is not started when an intent is sent, it will wait in the buffer, and will be processed once the store is started.
Alias for IntentReceiver.intent for multiple intents
An alias for pro.respawn.flowmvi.api.IntentReceiver.intent (LambdaIntent (block))
Write a message to StoreLogger. Tag is the Store.name by default.
Alias for ActionReceiver.send for multiple actions
Alias for IntentReceiver.intent
Alias for IntentReceiver.intent for multiple intents
An alias for pro.respawn.flowmvi.api.IntentReceiver.send (LambdaIntent (block))
Subscribe to the store. An overload of Store.subscribe that is applied on CoroutineScope.
Obtain the current StateProvider.state and update it with the result of transform.
A typed overload of StateReceiver.updateState.
A function that obtains current state and updates it atomically (in the thread context), and non-atomically in the coroutine context, which means it can cause races when you want to update states in parallel.
A typed overload of StateReceiver.updateStateImmediate.