Exemplo n.º 1
0
        public IPropagatorBlock <IDataflowMessage <TIn>, IDataflowMessage <TOut> > CreateDelayingTransformMany <TIn, TOut>(ITransformMany <TIn, TOut> transformation, int boundedCapacity = -1)
        {
            var transFunc = transformation
                            .WithExceptionHandler(m_LogAgent, this)
                            .WithLogging(m_LogAgent)
                            //.WithWorkloadStatistics(boundedCapacity, ()=> )
            ;

            if (m_LogStatistics)
            {
                transFunc = transFunc.WithStatistics(m_LogAgent);
                m_StatisticsLoggers.Add((IStatisticsLogger)transFunc);
            }

            var block = CustomBlocks.CreateThrottledTransformMany(
                transFunc
                .AsFunction(), CreateDefaultExecutionOptions(boundedCapacity)
                );

            return(block);
        }