private async Task SubscribeConsumer <T>(ITransactionalStreamProvider <T> provider,
                                                 ITransactionalStreamConsumer <T> consumer)
        {
            var streamIdentities = await provider.GetStreamIdentity();

            await consumer.SetInput(streamIdentities);
        }
        public static async Task <StreamProcessorChain <TIn, TOut, TFactory> > SelectMany <TIn, TIntermediate, TOut, TFactory>(
            this ITransactionalStreamProvider <TIn> source, Expression <Func <TIn, IEnumerable <TIntermediate> > > collectionSelectorFunc, Expression <Func <TIn, TIntermediate, TOut> > resultSelectorFunc,
            TFactory factory, int scatterFactor = 1) where TFactory : IStreamProcessorAggregateFactory
        {
            var aggregateConfiguration = new StreamProcessorAggregateConfiguration(await source.GetOutputStreams(), scatterFactor);
            var processorAggregate     = await factory.CreateSelectMany(collectionSelectorFunc, resultSelectorFunc, aggregateConfiguration);

            var processorChain = new StreamProcessorChainStart <TIn, TOut, TFactory>(processorAggregate, source, factory);

            return(processorChain);
        }
        public static async Task <StreamProcessorChain <TIn, TIn, TFactory> > Where <TIn, TFactory>(this ITransactionalStreamProvider <TIn> source, Expression <Func <TIn, bool> > filterFunc,
                                                                                                    TFactory factory, int scatterFactor = 1) where TFactory : IStreamProcessorAggregateFactory
        {
            var aggregateConfiguration = new StreamProcessorAggregateConfiguration(await source.GetOutputStreams(), scatterFactor);
            var processorAggregate     = await factory.CreateWhere(filterFunc, aggregateConfiguration);

            var processorChain = new StreamProcessorChainStart <TIn, TIn, TFactory>(processorAggregate, source, factory);

            return(processorChain);
        }
示例#4
0
 public StreamProcessorChainStart(IStreamProcessorAggregate <TIn, TOut> aggregate, ITransactionalStreamProvider <TIn> source, TFactory factory)
     : base(aggregate, factory)
 {
     _source = source;
 }