-
Notifications
You must be signed in to change notification settings - Fork 459
Open
Labels
Description
What version are you currently using?
2.0.0-alpha.1
What would you like to see?
Similarly to nested transaction, I want to be able to automatically created nested Sagas. This can easily be done by injecting the SagaContext
into the CoroutineContext
, if nested sagas are configured, and any nested Saga could automatically be nested into the parent. This machinery should be internal to Resilience, so all new code to add this functionality should be private, and not inlined.
private class SagaContext(private val scope: SagaScope): CoroutineContext
private fun sagaContext(): SagaContext? = TODO()
fun <A> sagaScope(
allowNested: Boolean = false,
block: SagaScope.() -> A
): Saga<A> {
...
}