mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-11-17 13:53:49 +00:00
rewrite the way to use onStateHandlingErrorHandler inside of DefaultStatesMachine
This commit is contained in:
parent
b22fbfb3bc
commit
18908a01d7
@ -71,7 +71,11 @@ open class DefaultStatesMachine <T: State>(
|
|||||||
/**
|
/**
|
||||||
* Will call [launchStateHandling] for state handling
|
* Will call [launchStateHandling] for state handling
|
||||||
*/
|
*/
|
||||||
override suspend fun StatesMachine<in T>.handleState(state: T): T? = launchStateHandling(state, handlers, onStateHandlingErrorHandler)
|
override suspend fun StatesMachine<in T>.handleState(state: T): T? = launchStateHandling(state, handlers)
|
||||||
|
|
||||||
|
override suspend fun launchStateHandling(state: T, handlers: List<CheckableHandlerHolder<in T, T>>): T? {
|
||||||
|
return launchStateHandling(state, handlers, onStateHandlingErrorHandler)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This
|
* This
|
||||||
@ -80,7 +84,7 @@ open class DefaultStatesMachine <T: State>(
|
|||||||
protected val statesJobsMutex = Mutex()
|
protected val statesJobsMutex = Mutex()
|
||||||
|
|
||||||
protected open suspend fun performUpdate(state: T) {
|
protected open suspend fun performUpdate(state: T) {
|
||||||
val newState = launchStateHandling(state, handlers, onStateHandlingErrorHandler)
|
val newState = launchStateHandling(state, handlers)
|
||||||
if (newState != null) {
|
if (newState != null) {
|
||||||
statesManager.update(state, newState)
|
statesManager.update(state, newState)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user