Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

["Request"] Resilience Saga allow #3432

Open
nomisRev opened this issue May 18, 2024 · 0 comments
Open

["Request"] Resilience Saga allow #3432

nomisRev opened this issue May 18, 2024 · 0 comments

Comments

@nomisRev
Copy link
Member

nomisRev commented May 18, 2024

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> {
   ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant