Create Snapshot with CommandInterpreter pattern? #66
-
In docs not enough information about Snapshot. How I understand snapshot is simple command (implementing serialization/desirialization in CommandFormatter etc). How concatinate WriteToAsync in inherit from SnapshotBuilder and Command? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @datasatanic , you need to use |
Beta Was this translation helpful? Give feedback.
Hi @datasatanic , you need to use
CommandHandlerAttribute
withIsSnapshotHandler
as mentioned in the documentation. This allows to capture snapshot entry when replaying log at application startup.SnapshotBuilder
is ephemeral log entry so you need it only for implementing snapshot construction logic. Inside of snapshot builder you can construct a command representing the snapshot and call your formatter fromWriteToAsync
implementation.