public void last_encountered_with_no_known_sequence() { var page = new EventPage(0, 100, new List<IEvent>()) { NextKnownSequence = 0, LastKnownSequence = 1000 }; page.LastEncountered().ShouldBe(1000); }
public void last_encountered_empty_page() { var page = new EventPage(0, 100, new List<IEvent>()) { NextKnownSequence = 150, LastKnownSequence = 1000 }; page.LastEncountered().ShouldBe(149); }
public void last_encountered_with_non_zero_page() { var page = new EventPage(0, 100, new List<IEvent> {new Event<ProjectStarted>(new ProjectStarted())}) { NextKnownSequence = 0, LastKnownSequence = 1000 }; page.Sequences.Add(97); page.Sequences.Add(98); page.Sequences.Add(99); page.LastEncountered().ShouldBe(1000); }
private async Task executePage(EventPage page, CancellationToken cancellation) { using (var session = _store.OpenSession()) { await _projection.ApplyAsync(session, page.Streams, cancellation).ConfigureAwait(false); session.QueueOperation(new EventProgressWrite(_events, _projection.Produces.FullName, page.To)); await session.SaveChangesAsync(cancellation).ConfigureAwait(false); _logger.PageExecuted(page, this); // This is a change to accomodate the big gap problem LastEncountered = page.LastEncountered(); evaluateWaiters(); UpdateBlock?.Post(new StoreProgress(_projection.Produces, page)); } }
private async Task executePage(EventPage page, CancellationToken cancellation) { // TODO -- have to pass in the tenant here using (var session = _store.OpenSession()) { await _projection.ApplyAsync(session, page, cancellation).ConfigureAwait(false); session.QueueOperation(new EventProgressWrite(_events, _projection.GetEventProgressionName(), page.To)); await session.SaveChangesAsync(cancellation).ConfigureAwait(false); // Just making sure nothing bad is happening to GC page.Next = null; _logger.PageExecuted(page, this); // This is a change to accomodate the big gap problem LastEncountered = page.LastEncountered(); evaluateWaiters(); UpdateBlock?.Post(new StoreProgress(_projection.ProjectedType(), page)); } }
private async Task executePage(EventPage page, CancellationToken cancellation) { using (var session = _store.OpenSession()) { await _projection.ApplyAsync(session, page.Streams, cancellation).ConfigureAwait(false); session.QueueOperation(new EventProgressWrite(_events, _projection.Produces.FullName, page.To)); await session.SaveChangesAsync(cancellation).ConfigureAwait(false); _logger.PageExecuted(page, this); // This is a change to accomodate the big gap problem LastEncountered = page.LastEncountered(); evaluateWaiters(); UpdateBlock?.Post(new StoreProgress(_projection.Produces, page)); } }