示例#1
0
 public Poller(IReadOnlyEventStore readOnlyEventStore, int interval = 1000)
 {
     _readOnlyEventStore = readOnlyEventStore;
     _timer = new Timer(interval)
     {
         AutoReset = false
     };
     _timer.Elapsed += (_, __) => Poll().SwallowException();
 }
示例#2
0
 protected SubscriptionBase(
     IReadOnlyEventStore readOnlyEventStore,
     IObservable <Unit> eventStoreAppendedNotification,
     StreamEventReceived streamEventReceived,
     SubscriptionDropped subscriptionDropped = null,
     string name = null)
 {
     ReadOnlyEventStore             = readOnlyEventStore;
     EventStoreAppendedNotification = eventStoreAppendedNotification;
     StreamEventReceived            = streamEventReceived;
     Name = string.IsNullOrWhiteSpace(name) ? Guid.NewGuid().ToString() : name;
     SubscriptionDropped = subscriptionDropped ?? ((_, __) => { });
 }
 public AllStreamSubscription(
     long?fromCheckpoint,
     IReadOnlyEventStore readOnlyEventStore,
     IObservable <Unit> eventStoreAppendedNotification,
     StreamEventReceived streamEventReceived,
     SubscriptionDropped subscriptionDropped = null,
     string name = null)
     : base(readOnlyEventStore, eventStoreAppendedNotification, streamEventReceived, subscriptionDropped, name)
 {
     FromCheckpoint  = fromCheckpoint;
     LastCheckpoint  = fromCheckpoint;
     _nextCheckpoint = fromCheckpoint + 1 ?? Checkpoint.Start;
 }
示例#4
0
 public StreamSubscription(
     string streamId,
     int startVersion,
     IReadOnlyEventStore readOnlyEventStore,
     IObservable <Unit> eventStoreAppendedNotification,
     StreamEventReceived streamEventReceived,
     SubscriptionDropped subscriptionDropped,
     string name = null)
     : base(readOnlyEventStore, eventStoreAppendedNotification, streamEventReceived, subscriptionDropped, name)
 {
     _streamId    = streamId;
     _nextVersion = startVersion;
     _lastVersion = startVersion - 1;
 }