Пример #1
0
            protected override void Context()
            {
                _trackedCommitAttempts = new[]
                {
                    BuildCommit(Guid.NewGuid(), Guid.NewGuid()),
                    BuildCommit(Guid.NewGuid(), Guid.NewGuid()),
                    BuildCommit(Guid.NewGuid(), Guid.NewGuid())
                };

                _hook = new OptimisticPipelineHook(MaxStreamsToTrack);
            }
Пример #2
0
            protected override Task Context()
            {
                _trackedCommitAttempts = new[]
                {
                    BuildCommit(Guid.NewGuid(), Guid.NewGuid()),
                    BuildCommit(Guid.NewGuid(), Guid.NewGuid()),
                    BuildCommit(Guid.NewGuid(), Guid.NewGuid())
                };

                _hook = new OptimisticPipelineHook(MaxStreamsToTrack);
                return(Task.FromResult(true));
            }
Пример #3
0
        private static IStoreEvents BuildEventStore(NanoContainer context)
        {
            var scopeOption = context.Resolve <TransactionScopeOption>();
            OptimisticPipelineHook concurrency = scopeOption == TransactionScopeOption.Suppress ? new OptimisticPipelineHook() : null;
            var upconverter = context.Resolve <EventUpconverterPipelineHook>();

            ICollection <IPipelineHook> hooks = context.Resolve <ICollection <IPipelineHook> >() ?? new IPipelineHook[0];

            hooks = new IPipelineHook[] { concurrency, upconverter }
            .Concat(hooks)
            .Where(x => x != null)
            .ToArray();

            return(new OptimisticEventStore(context.Resolve <IPersistStreams>(), hooks));
        }
        protected override void Context()
        {
            TrackedCommits = new[]
            {
                BuildCommit(Guid.NewGuid(), Guid.NewGuid()),
                BuildCommit(Guid.NewGuid(), Guid.NewGuid()),
                BuildCommit(Guid.NewGuid(), Guid.NewGuid())
            };

            hook = new OptimisticPipelineHook(MaxStreamsToTrack);
        }
 protected override void Context()
 {
     _trackedCommit = BuildCommit(Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid());
     _hook          = new OptimisticPipelineHook();
     _hook.Track(_trackedCommit);
 }
 protected override void Context()
 {
     _trackedCommit = BuildCommit(_bucketId, Guid.NewGuid(), Guid.NewGuid());
     _trackedCommitDeleted = BuildCommit(_bucketId, _streamIdDeleted, Guid.NewGuid());
     _hook = new OptimisticPipelineHook();
     _hook.Track(_trackedCommit);
     _hook.Track(_trackedCommitDeleted);
 }
 protected override void Context()
 {
     _trackedCommitBucket1 = BuildCommit(Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid());
     _trackedCommitBucket2 = BuildCommit(Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid());
     _hook = new OptimisticPipelineHook();
     _hook.Track(_trackedCommitBucket1);
     _hook.Track(_trackedCommitBucket2);
 }
            protected override Task Context()
            {
                _trackedCommit = BuildCommit(_bucketId, Guid.NewGuid(), Guid.NewGuid());
                _trackedCommitDeleted = BuildCommit(_bucketId, _streamIdDeleted, Guid.NewGuid());
                _hook = new OptimisticPipelineHook();
                _hook.Track(_trackedCommit);
                _hook.Track(_trackedCommitDeleted);
				return Task.FromResult(true);
            }
            protected override Task Context()
            {
                _trackedCommitBucket1 = BuildCommit(Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid());
                _trackedCommitBucket2 = BuildCommit(Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid());
                _hook = new OptimisticPipelineHook();
                _hook.Track(_trackedCommitBucket1);
                _hook.Track(_trackedCommitBucket2);
				return Task.FromResult(true);
            }
            protected override Task Context()
            {
                _trackedCommitAttempts = new[]
                {
                    BuildCommit(Guid.NewGuid(), Guid.NewGuid()),
                    BuildCommit(Guid.NewGuid(), Guid.NewGuid()),
                    BuildCommit(Guid.NewGuid(), Guid.NewGuid())
                };

                _hook = new OptimisticPipelineHook(MaxStreamsToTrack);
				return Task.FromResult(true);
            }