refactor(eventstore): rename EventPusher to Command, EventReader to Event, PushEvents to Push and FilterEvents to Filter (#2907)

This commit is contained in:
Silvan
2022-01-03 09:19:07 +01:00
committed by GitHub
parent 9a374f9c5c
commit 09be70949f
339 changed files with 1436 additions and 1346 deletions

View File

@@ -23,7 +23,7 @@ type Update func(context.Context, []*Statement, Reduce) (unexecutedStmts []*Stat
//Reduce reduces the given event to a statement
//which is used to update the projection
type Reduce func(eventstore.EventReader) (*Statement, error)
type Reduce func(eventstore.Event) (*Statement, error)
//Lock is used for mutex handling if needed on the projection
type Lock func(context.Context, time.Duration) <-chan error
@@ -156,7 +156,7 @@ func (h *ProjectionHandler) Process(
func (h *ProjectionHandler) processEvent(
ctx context.Context,
event eventstore.EventReader,
event eventstore.Event,
reduce Reduce,
) error {
stmt, err := reduce(event)
@@ -262,7 +262,7 @@ func (h *ProjectionHandler) fetchBulkStmts(
return false, err
}
events, err := h.Eventstore.FilterEvents(ctx, eventQuery)
events, err := h.Eventstore.Filter(ctx, eventQuery)
if err != nil {
logging.LogWithFields("HANDL-X8vlo", "projection", h.ProjectionName).WithError(err).Info("Unable to bulk fetch events")
return false, err