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

Docs: need to mention SaveSnapshot state must be passed in immutable manner #5058

Open
christallire opened this issue Jun 2, 2021 · 1 comment
Labels

Comments

@christallire
Copy link

christallire commented Jun 2, 2021

Please describe what you are trying to understand
I recently went through exactly same issue with #4451 and I did exactly what he did. I even looked through JVM document and sources.

Which pages have you looked at?
https://getakka.net/articles/persistence/snapshots.html

What did these pages not make clear?
in classic Akka all messages must be immutable, and since you are putting your state inside a message (SaveSnapshot), then it needs to be immutable as well.

How can we do it better?
Please mention this in the doc

Additional suggestions
I'm not sure why both https://doc.akka.io/docs/akka/current/persistence.html and https://getakka.net/articles/persistence/snapshots.html not mentioning anything about immutable -- is there any chance that the JVM does it implicitly?

@Aaronontheweb
Copy link
Member

@christallire the JVM doesn't necessarily do it implicitly - case classes and other types of objects can be immutable, but since it's user-land data types that end up in snapshots it's incumbent upon the user to take care of this.

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

No branches or pull requests

2 participants