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

Better long-running transitions #18

Open
psh opened this issue Jan 26, 2023 · 0 comments
Open

Better long-running transitions #18

psh opened this issue Jan 26, 2023 · 0 comments

Comments

@psh
Copy link
Owner

psh commented Jan 26, 2023

Dig deeper into using https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.coroutines/suspend-coroutine.html and https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.coroutines/-continuation/ for long running transitions.

The "fail()" and "failAndExit()" semantics arent great. We should define "Success" and "Failure" for the transition continuation type (sealed class?) and allow the transition block to call continuation.resume(...) - assuming that's replacing

  • success()
  • failAndExit()

And then treat continuation.resumeWithException(...) as the version that doesnt call the exit handler? This would give a stable entry / exit behaviour as the general case, and could look at passing the "Success" / "Failure" transition result into the exit block for reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant