-
Notifications
You must be signed in to change notification settings - Fork 97
feature/go_support – paradox documentation and TCK #128
feature/go_support – paradox documentation and TCK #128
Conversation
@viktorklang after reviewed, I have some changes pending for this PR here, depending on a few issues working on the go-support repo, so not yet merge it please. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM after having a look at the comments!
…ll as API changes reflected from the latest updates to the go-support repo.
@viktorklang This PR with fd409c0 is now coherent with the state of cloudstateio/go-support#10 |
|
||
@@snip [shoppingcart.go](/docs/src/main/paradox/user/lang/go/src/shoppingcart.go) { #item-added } | ||
|
||
## Producing and handling snapshots | ||
|
||
## Multiple behaviors | ||
Snapshots are an important optimisation for event sourced entities that may contain many events, to ensure that they can be loaded quickly even when they have very long journals. To produce a snapshot, the `cloudstate.Snapshotter` interface has to be implemented that must return a snapshot of the current state in serializable form. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it should be optional to implement this interface, as otherwise by default users might get poor performance and not knowing why. Is that the case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. The text here is a 1:1 from the documentation in the java support.
Implementation wise we might probably ensure an entity implements this interface otherwise a compilation error would be raised, similar to the EventHandler
and the CommandHandler
in the case of this support library.
The spec says:
// If present the entity should initialise its state using this snapshot.
EventSourcedSnapshot snapshot = 3;
so far. Though, this should be implemented the same over different support libraries. I have not checked if others raise a runtime check exception or the like.
This PR provides CloudState paradox documentation for go-support / #3 . Beside the documentation the TCK is configured to run the Go Shopping Cart example during the TCK run.
As discussed in the weekly call 2019-10-08, the protobuf protocol files include the
go_package
option.A corresponding PR with the go-support itself follows in its separate repository.
Note: To (p)review the documentation run the following
this should open a browser window with the generated documentation.
TCK Run: https://travis-ci.com/marcellanz/cloudstate/jobs/244932734#L858