protected override void Context() { base.Context(); StoreEvents.Advanced.CommitSingle(); _observeCommits = PollingClient.ObserveFrom(); _commitObserved = _observeCommits.FirstAsync().ToTask(); }
protected override void Context() { base.Context(); StoreEvents.Advanced.CommitSingle(); _observeCommits = PollingClient.ObserveFrom(); _twoCommitsObserved = _observeCommits.Take(2).ToTask(); }
protected override void Context() { base.Context(); StoreEvents.Advanced.CommitSingle(); _observeCommits1 = PollingClient.ObserveFrom(); _observeCommits1Complete = _observeCommits1.Take(5).ToTask(); _observeCommits2Complete = _observeCommits1.Take(10).ToTask(); }
protected override void Context() { base.Context(); StoreEvents.Advanced.CommitMany(4, null, "bucket_2"); StoreEvents.Advanced.CommitMany(4, null, "bucket_1"); _observeCommits = PollingClient.ObserveFrom(); _commitObserved = _observeCommits.FirstAsync().ToTask(); }
protected override Task Context() { base.Context(); StoreEvents.Advanced.CommitSingle(); _observeCommits = PollingClient.ObserveFrom(); _commitObserved = _observeCommits.FirstAsync().ToTask(); return(Task.FromResult(true)); }
protected override void Context() { base.Context(); StoreEvents.Advanced.CommitSingle(); _observeCommits = PollingClient.ObserveFrom(); _subscriberException = new Exception(); _subscription = _observeCommits.Subscribe(c => { throw _subscriberException; }, ex => _onErrorException = ex); }
protected override async Task Context() { await base.Context(); await StoreEvents.Advanced.CommitSingleAsync(); _observeCommits = PollingClient.ObserveFrom(); _twoCommitsObserved = _observeCommits.Take(2).ToTask(); }
protected override async Task Context() { await base.Context(); await StoreEvents.Advanced.CommitSingleAsync(); _observeCommits1 = PollingClient.ObserveFrom(); _observeCommits1Complete = _observeCommits1.Take(5).ToTask(); _observeCommits2Complete = _observeCommits1.Take(10).ToTask(); }
protected override void Because() { PollingClient.Start(); Task.Factory.StartNew(() => { for (int i = 0; i < 15; i++) { StoreEvents.Advanced.CommitSingle(); } }); }
protected override async Task Context() { await base.Context(); await StoreEvents.Advanced.CommitMany(4, null, "bucket_2"); await StoreEvents.Advanced.CommitMany(4, null, "bucket_1"); _observeCommits = PollingClient.ObserveFromBucket("bucket_1"); _commitObserved = _observeCommits.FirstAsync().ToTask(); }
protected override Task Because() { PollingClient.Start(); return(Task.Run( async() => { for (int i = 0; i < 15; i++) { await StoreEvents.Advanced.CommitSingleAsync(); } })); }
public void Start() { var start = _tracker.LoadCheckpoint(); var client = new PollingClient(_eventStore.Advanced, 1000); var dispatcher = new CommitsDispatcher(_tracker, Logger); _observer = client.ObserveFrom(start); _subscription = _observer.Subscribe(dispatcher); _observer.Start(); Logger.InfoFormat("Projection engine started from {0}", start); }
protected override void Context() { base.Context(); StoreEvents.Advanced.CommitSingle(); _observeCommits = PollingClient.ObserveFrom(); _commitObserved = _observeCommits.FirstAsync().ToTask(); _observeCommits.Start(); _commitObserved.Wait(PollingInterval * 2); _observeCommits.Dispose(); StoreEvents.Advanced.CommitSingle(); string checkpointToken = _commitObserved.Result.CheckpointToken; _observeCommits = PollingClient.ObserveFrom(checkpointToken); }
protected override async Task Context() { await base.Context(); await StoreEvents.Advanced.CommitSingle(); _observeCommits = PollingClient.ObserveFrom(); _commitObserved = _observeCommits.FirstAsync().ToTask(); await _observeCommits.Start(); var task = await Task.WhenAny(_commitObserved, Task.Delay(PollingInterval * 2)); task.Should().Be(_commitObserved); _observeCommits.Dispose(); await StoreEvents.Advanced.CommitSingle(); string checkpointToken = _commitObserved.Result.CheckpointToken; _observeCommits = PollingClient.ObserveFrom(checkpointToken); }
private static void Main() { using (var store = WireupEventStore()) { var client = new PollingClient(store.Advanced); string checkpointToken = LoadCheckpoint(); using (IObserveCommits observeCommits = client.ObserveFrom(checkpointToken)) using (observeCommits.Subscribe(commit => { // Project the commit etc Console.WriteLine(Resources.CommitInfo, commit.BucketId, commit.StreamId, commit.CommitSequence); // Track the most recent checkpoint checkpointToken = commit.CheckpointToken; })) { observeCommits.Start(); Console.WriteLine(Resources.PressAnyKey); Console.ReadKey(); SaveCheckpoint(checkpointToken); } } }
protected override void Because() { PollingClient.Start(); StoreEvents.Advanced.CommitSingle(); }
protected override Task Context() { _storeEvents = Wireup.Init().UsingInMemoryPersistence().Build(); _pollingClient = new PollingClient(_storeEvents.Advanced, PollingInterval); return(Task.FromResult(true)); }
protected override void Cleanup() { PollingClient.Dispose(); }
protected override void Because() { PollingClient.Start(); }
protected override Task Because() { PollingClient.Start(); return(StoreEvents.Advanced.CommitSingleAsync()); }
protected override void Because() { PollingClient.StartFromBucket("bucket_1"); }
protected override Task Because() { PollingClient.StartFromBucket("bucket_1"); return(Task.CompletedTask); }
protected override Task Because() { PollingClient.Start(); return(Task.CompletedTask); }
protected override Task Cleanup() { PollingClient.Dispose(); return(Task.CompletedTask); }
protected override void Context() { _storeEvents = Wireup.Init().UsingInMemoryPersistence().Build(); _pollingClient = new PollingClient(_storeEvents.Advanced, PollingInterval); }
protected override Task Context() { _storeEvents = Wireup.Init().UsingInMemoryPersistence().Build(); _pollingClient = new PollingClient(_storeEvents.Advanced, PollingInterval); return Task.FromResult(true); }
public EventStoreClient(PollingClient pollingClient) { _pollingClient = pollingClient; }