Explicitly refresh persisted snapshot with events starting at forceStartAt
.
Explicitly refresh persisted snapshot with events starting at forceStartAt
. Normally to refresh a snapshot,
your implementation of QueryAPI can do so asynchronously via a custom onGenerateLatestSnapshot
function.
WARNING - Use this only if you know that events prior to forceStartAt
can be safely ignored. Typically this is
when a single event stream contains events for multiple entities, so obviously when you create a new entity, you
can ignore all events prior to that creation event.
The key
Generate a snapshot starting from events at the specified sequence number. This should only be used when it is known that preceding events can be ignored. For example when new entities are added, there are no views of those entities before the events that add them!
Error when saving snapshot or the snapshot that was saved.
Generates the latest snapshot by retrieving the last persisted snapshot and then replaying events on top of that.
Return the current view of the data for key 'key'
Return the view of the data for the key 'key' at the specified timestamp.
Return the view of the data for the key 'key' at the specified timestamp.
The key
The timestamp at which we want to see the view of the data
view of the data with events up to the given time stamp.
Return the view of the data for the key 'key' at the specified sequence number.
Return the view of the data for the key 'key' at the specified sequence number.
the key
the sequence number of the event at which we want the see the view of the data.
view of the data at event with sequence 'seq'
Get a stream of Snapshots starting from sequence number 'from' (if defined).
Get a stream of Snapshots starting from sequence number 'from' (if defined).
The key
Starting sequence number. None to get from the beginning of the stream.
a stream of Snapshots starting from sequence number 'from' (if defined).
the current view wrapped in Snapshot of the data for key 'key'
Save the given snapshot
if it is at a different sequence number to previousSnapshot
.
Save the given snapshot
if it is at a different sequence number to previousSnapshot
.
Set previousSnapshot
to None to force a save.