vector / com.haroldadmin.vector.state / StateProcessor
StateProcessor¶
interface StateProcessor<S :
VectorState
> : CoroutineScope
An entity that manages any Action on state.
Parameters¶
S
-
The state type implementing VectorState
A SetStateAction is be processed before any existing GetStateAction in the queue A GetStateAction is given the latest state value as it's parameter
Functions¶
Name | Summary |
---|---|
clearProcessor | abstract fun clearProcessor(): Unit Cleanup any resources held by this processor. |
offerGetAction | abstract fun offerGetAction(action: suspend ( S ) -> Unit ): Unit Offer a GetStateAction to this processor. The state parameter supplied to this action shall be the latest state value at the time of processing this action. |
offerSetAction | abstract fun offerSetAction(reducer: suspend S .() -> S ): Unit Offer a SetStateAction to this processor. This action will be processed as soon as possible, before all existing GetStateAction waiting in the queue, if any. |
Inheritors¶
Name | Summary |
---|---|
StateStore | abstract class StateStore<S : VectorState > : StateHolder < S >, StateProcessor < S > A class which can hold current state as well as handle actions to be performed on it. |