Example #1
0
 public SortedStream(ITraceMapper tracer, IExecutionContext executionContext, string sourceNodeName, IPushObservable <T> observable, SortDefinition <T, TKey> sortDefinition)
     : base(tracer, executionContext, sourceNodeName, observable)
 {
     if (sortDefinition == null)
     {
         throw new ArgumentOutOfRangeException(nameof(sortDefinition), "sorting criteria list cannot be empty");
     }
     this.SortDefinition = sortDefinition;
 }
Example #2
0
        public Stream(ITraceMapper traceMapper, IExecutionContext executionContext, string sourceNodeName, IPushObservable <T> observable)
        {
            this.TraceMapper      = traceMapper;
            this.SourceNodeName   = sourceNodeName;
            this.ExecutionContext = executionContext;

            this.Observable = observable.TakeUntil(executionContext.StopProcessEvent);

            if (traceMapper != null)
            {
                this.TraceObservable =
                    PushObservable.Merge <ITraceContent>(
                        this.Observable.ExceptionsToObservable().Map(e => new UnhandledExceptionStreamTraceContent(e)),
                        this.Observable.Count().Map(count => new CounterSummaryStreamTraceContent(count)),
                        this.Observable.Map((e, i) => new RowProcessStreamTraceContent(i + 1, e))
                        ).Map(i => traceMapper.MapToTrace(i, executionContext.NextTraceSequence()));
            }
        }
Example #3
0
 public SingleStream(ITraceMapper tracer, IExecutionContext executionContext, string sourceNodeName, IPushObservable <T> observable) : base(tracer, executionContext, sourceNodeName, observable, new SortDefinition <T, T>(i => i))
 {
 }
Example #4
0
 public override object GetMatchingStream(ITraceMapper tracer, IExecutionContext executionContext, string name, object observable)
 {
     return(new SingleStream <T>(tracer, executionContext, name, (IPushObservable <T>)observable));
 }
Example #5
0
 public override object GetMatchingStream(ITraceMapper tracer, IExecutionContext executionContext, string name, object observable)
 {
     return(new KeyedStream <T, TKey>(tracer, executionContext, name, (IPushObservable <T>)observable, this.SortDefinition));
 }