Esempio n. 1
0
 protected override void Context()
 {
     base.Context();
     StoreEvents.Advanced.CommitSingle();
     _observeCommits = PollingClient.ObserveFrom();
     _commitObserved = _observeCommits.FirstAsync().ToTask();
 }
Esempio n. 2
0
 protected override void Context()
 {
     base.Context();
     StoreEvents.Advanced.CommitSingle();
     _observeCommits     = PollingClient.ObserveFrom();
     _twoCommitsObserved = _observeCommits.Take(2).ToTask();
 }
Esempio n. 3
0
 protected override void Context()
 {
     base.Context();
     StoreEvents.Advanced.CommitSingle();
     _observeCommits1         = PollingClient.ObserveFrom();
     _observeCommits1Complete = _observeCommits1.Take(5).ToTask();
     _observeCommits2Complete = _observeCommits1.Take(10).ToTask();
 }
Esempio n. 4
0
 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();
 }
Esempio n. 5
0
 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();
        }
Esempio n. 9
0
 protected override void Because()
 {
     PollingClient.Start();
     Task.Factory.StartNew(() =>
     {
         for (int i = 0; i < 15; i++)
         {
             StoreEvents.Advanced.CommitSingle();
         }
     });
 }
Esempio n. 10
0
        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();
         }
     }));
 }
Esempio n. 12
0
        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);
        }
Esempio n. 13
0
        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);
        }
Esempio n. 14
0
        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);
        }
Esempio n. 15
0
        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);
                }
            }
        }
Esempio n. 16
0
 protected override void Because()
 {
     PollingClient.Start();
     StoreEvents.Advanced.CommitSingle();
 }
Esempio n. 17
0
 protected override Task Context()
 {
     _storeEvents   = Wireup.Init().UsingInMemoryPersistence().Build();
     _pollingClient = new PollingClient(_storeEvents.Advanced, PollingInterval);
     return(Task.FromResult(true));
 }
Esempio n. 18
0
 protected override void Cleanup()
 {
     PollingClient.Dispose();
 }
Esempio n. 19
0
 protected override void Because()
 {
     PollingClient.Start();
 }
 protected override Task Because()
 {
     PollingClient.Start();
     return(StoreEvents.Advanced.CommitSingleAsync());
 }
Esempio n. 21
0
 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);
 }
Esempio n. 26
0
 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);
        }
Esempio n. 28
0
 public EventStoreClient(PollingClient pollingClient)
 {
     _pollingClient = pollingClient;
 }