public void HandleSequencedEvent(SequencedEvent sequencedEvent, bool?runImmediately = true) { if (!sequencedEvent.HasEvent()) { return; } IDispatcherEventPublisher publisher = null; _transactor.ApplyTransactionForLambda(() => FinallyGuarded.Apply(() => { publisher = DispatcherEventPublisher(sequencedEvent, runImmediately); AuditLogStatus(sequencedEvent); }, () => { if (publisher != null) { _container.Release(publisher); } })); }
private static bool FinishedReplayingEvents(bool exitAtEndOfStream, SequencedEvent sequencedEvent) { return(exitAtEndOfStream && sequencedEvent != null && !sequencedEvent.HasEvent()); }