示例#1
0
        /// <inheritdoc/>
        public bool PassThrough(Processing.CommittedEventStreamWithContext committedEventStream)
        {
            if (!CanPassThrough(committedEventStream))
            {
                return(false);
            }
            _tunnel.PassThrough(committedEventStream);

            return(true);
        }
示例#2
0
 void PassThroughSingularity(IEnumerable <Commits> commitsArray, ISingularity singularity)
 {
     commitsArray.ForEach(commits => {
         commits.ForEach(commit => {
             var committedEventStreamWithContext = new Processing.CommittedEventStreamWithContext(commit, commit.Events.First().Metadata.OriginalContext.ToExecutionContext(commit.CorrelationId));
             if (singularity.CanPassThrough(committedEventStreamWithContext))
             {
                 singularity.PassThrough(committedEventStreamWithContext);
             }
         });
     });
 }
示例#3
0
 /// <inheritdoc/>
 public void PassThrough(Processing.CommittedEventStreamWithContext contextualEventStream)
 {
     try
     {
         var message = contextualEventStream.ToProtobuf();
         _outbox.Enqueue(message);
         _waitHandle.Set();
     }
     catch (Exception ex)
     {
         _logger.Error(ex, "Error creating and enqueueing committed event stream");
     }
 }
示例#4
0
 /// <inheritdoc/>
 public void PassThrough(Processing.CommittedEventStreamWithContext committedEventStream)
 {
     lock (_singularities)
     {
         _logger.Information($"Committed eventstream entering event horizon with {_singularities.Count} singularities");
         _singularities
         .Where(_ => _.CanPassThrough(committedEventStream)).AsParallel()
         .ForEach(_ =>
         {
             _logger.Information($"Passing committed eventstream through singularity identified with bounded context '{_.BoundedContext}' in application '{_.Application}'");
             _.PassThrough(committedEventStream);
         });
     }
 }
示例#5
0
 /// <inheritdoc/>
 public bool CanPassThrough(Processing.CommittedEventStreamWithContext committedEventStream)
 {
     return(_subscription.Events.Any(_ => committedEventStream.EventStream.Events.Any(e => e.Metadata.Artifact == _)));
 }