public JoiningReducer( SplittingAsyncReducer <TReduction> splitter, IAsyncReducer <TReduction, TResult> next) { Splitter = splitter; Next = next; }
public AsyncReducer( Catching <TInput, TResult, TException> transducer, IAsyncReducer <TReduction, TResult> next) : base(next) { success = transducer.Success.Apply(next); exceptional = transducer.Exceptional.Apply(next); }
public SplittingAsyncReducer( IList <TransducerSwitch <TInput, TResult> > transducers, IAsyncReducer <TReduction, TResult> next) { Reducers = transducers .Select(tSwitch => new AsyncReducerOption( tSwitch.Test, tSwitch.Transducer.Apply(new JoiningReducer(this, next)))) .ToList(); Next = next; }
public static async Task <Terminator <TReduction> > ReduceAsync <TInput, TReduction>( this IEnumerable <TInput> input, TReduction reduction, IAsyncReducer <TReduction, TInput> reducer) { var terminator = Terminator.Reduction(reduction); foreach (var value in input) { terminator = await reducer.InvokeAsync(terminator.Value, value).ConfigureAwait(false); if (terminator.IsTerminated) { return(terminator); } } return(await reducer.CompleteAsync(terminator.Value).ConfigureAwait(false)); }
public IAsyncReducer <TReduction, TInput> Apply <TReduction>(IAsyncReducer <TReduction, TInput> next) => new AsyncPrimary <TReduction>(Operation, next);
public AsyncReducerOption(Predicate <TInput> test, IAsyncReducer <TReduction, TInput> reducer) { Test = test; IsTerminated = false; Reducer = reducer; }
public IAsyncReducer <TReduction, TInput> Apply <TReduction>(IAsyncReducer <TReduction, TResult> next) => new AsyncReducer <TReduction>(this, next);
protected DefaultCompletionAsyncReducer(IAsyncReducer <TReduction, TForward> next) : base(next) { }
public AsyncReducer( Func <TInput, TResult> mappingFunction, IAsyncReducer <TReduction, TResult> reducer) : base(reducer) { MappingFunction = mappingFunction; }
public IAsyncReducer <TReduction, TInput> Apply <TReduction>(IAsyncReducer <TReduction, TInput> next) => new AsyncReducer <TReduction>(Test, next);
public IAsyncReducer <TReduction, TInput> Apply <TReduction>(IAsyncReducer <TReduction, TResult> next) => Async.Apply(next);
public IAsyncReducer <TReduction, int> Apply <TReduction>(IAsyncReducer <TReduction, GuessingGameResult> next) { throw new NotImplementedException(); }
public AsyncTail( IAsyncReducer <TReduction, TInput> primary, IAsyncReducer <TReduction, TInput> next) : base(next) { Loop = primary; }
public AsyncPrimary( ITransducer <TInput, TInput> operation, IAsyncReducer <TReduction, TInput> next) { Next = operation.Apply(new AsyncTail <TReduction>(this, next)); }
public IAsyncReducer <TReduction, T> Apply <TReduction>(IAsyncReducer <TReduction, T> next) => new AsyncReducer <TReduction>(this, next);
public AsyncReducer( BaseAccumulationTransducer <T> transducer, IAsyncReducer <TReduction, T> next) : base(next) { Transducer = transducer; }
public IAsyncReducer <TReduction, T> Apply <TReduction>(IAsyncReducer <TReduction, IList <T> > next) => new AsyncReducer <TReduction>(Window, next);
public AsyncReducer( int windowSize, IAsyncReducer <TReduction, IList <T> > next) : base(next) { Container = new WindowContainer(windowSize); }
public IAsyncReducer <TReduction, TInput> Apply <TReduction>(IAsyncReducer <TReduction, TResult> next) => new SplittingAsyncReducer <TReduction>(Transducers, next);
public IAsyncReducer <TReduction, TInput> Apply <TReduction>(IAsyncReducer <TReduction, TResult> next) { throw new NotImplementedException(); }
public IAsyncReducer <TReduction, TInput> Apply <TReduction>(IAsyncReducer <TReduction, TResult> next) => Left.Apply(Right.Apply(next));
public IAsyncReducer <TReduction, Task <TInput> > Apply <TReduction>(IAsyncReducer <TReduction, TInput> next) => new Reducer <TReduction>(next);
public AsyncReducer( Predicate <TInput> test, IAsyncReducer <TReduction, TInput> next) : base(next) { Test = test; }
public Reducer(IAsyncReducer <TReduction, TInput> next) : base(next) { }
public IAsyncReducer <TReduction, T> Apply <TReduction>(IAsyncReducer <TReduction, T> next) => next;
public AsyncReducer(Predicate <T> test, IAsyncReducer <Reduction, T> next) : base(next) { Test = test; }
public IAsyncReducer <TReduction, TInput> Apply <TReduction>(IAsyncReducer <TReduction, TResult> next) => new AsyncReducer <TReduction>(MappingFunction, next);
protected BaseAsyncReducer(IAsyncReducer <TReduction, TForward> next) { Next = next; }