Skip to content
This repository has been archived by the owner on Mar 16, 2022. It is now read-only.

feature/go_support – paradox documentation and TCK #128

Merged
merged 7 commits into from
Oct 29, 2019
Merged

feature/go_support – paradox documentation and TCK #128

merged 7 commits into from
Oct 29, 2019

Conversation

marcellanz
Copy link
Contributor

@marcellanz marcellanz commented Oct 11, 2019

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

> sbt docs/paradoxBrowse
> sbt ~docs/paradox

this should open a browser window with the generated documentation.

TCK Run: https://travis-ci.com/marcellanz/cloudstate/jobs/244932734#L858

@marcellanz
Copy link
Contributor Author

@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.

Copy link
Contributor

@viktorklang viktorklang left a 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.
@marcellanz
Copy link
Contributor Author

@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.
Copy link
Contributor

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?

Copy link
Contributor Author

@marcellanz marcellanz Oct 24, 2019

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.

@viktorklang
Copy link
Contributor

@marcellanz 👍

@viktorklang
Copy link
Contributor

@jsravn @jroper OK to merge?

@viktorklang
Copy link
Contributor

@jsravn @jroper Merging without comment

@viktorklang viktorklang merged commit 860f020 into cloudstateio:master Oct 29, 2019
@marcellanz marcellanz deleted the feature/go-support_doc_and_tck branch October 29, 2019 19:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants