public Poller(IReadOnlyEventStore readOnlyEventStore, int interval = 1000) { _readOnlyEventStore = readOnlyEventStore; _timer = new Timer(interval) { AutoReset = false }; _timer.Elapsed += (_, __) => Poll().SwallowException(); }
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; }
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; }