Documentation is too shallow, real life example should be added #115
Unanswered
michaelklopf
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As someone who has no deep knowledge of event sourcing and having seen how it's done over at Spaties Laravel event sourcing package, I'd wish for one example to include how state and events are consumed by the application.
In Spaties package you create an aggregate, call that in the controller, it will create the event with the data
(uuid comes from a helper function in the model) and the aggregate records the event, i.e. writes the event to db
the event
and a projector that writes it to database somewhere down the line
How does this package work now, I don't get it from the example code.
Fire the event in the controller?
The event may look something like this
The state is bare bones
The unique id is set by the
HasSnowflakes
trait.But nothing is happening when firing the event (I did it in Tinkerwell during these tests).
But when I change the line to as seen in the example here https://verbs.thunk.dev/docs/reference/events/#content-committing--immediately-accessing-results
Then it works.
Spaties package also goes into detail how to setup the queue. What is necessary to make fire work? Am I doing it wrong or configuring it wrong?
edit Just read the fire part of the docs again and propably mixed up console execution with tinkerwell. When I add
Verbs::commit()
to Tinkerwell it works.I think an example which covers all bases would help to get a better understanding how "regular" event sourcing is applied in the package here.
Beta Was this translation helpful? Give feedback.
All reactions