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

Why require a saga state? #19

Open
izzycoding opened this issue Jan 22, 2021 · 1 comment
Open

Why require a saga state? #19

izzycoding opened this issue Jan 22, 2021 · 1 comment

Comments

@izzycoding
Copy link

If I am reading the intent correctly then the state hardly ever requires more than the I’d and correlation id.

so I wonder if it would be useful to provide a general saga state class such that the saga doesn’t require the manual registration of different state types explicitly?

public class Saga<T> could internally create a public record SimpleSagaState<T>(...) where “T” is the saga class defined by the user.
Also the saga registration at startup would no longer need the be explicit about registering a state type.

Or is the state able to store other data too?

@mizrael
Copy link
Owner

mizrael commented Jan 22, 2021

the Saga state can be used to store additional data. Thanks for pointing this out, I'll add another sample showing this.
I also like the idea of the SimpleSaga class, exposing just the id and correlation id. Would make the code way easier.

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

2 participants