public Int32 ProcessNext(TInput input, Int32?maxToDistribute)
 {
     IsProcessingWorkItem = true;
     try
     {
         var res = Worker.Process(input);
         return(maxToDistribute == null?Distribute(res)
                    : Distribute(res, maxToDistribute.Value));
     }
     finally { IsProcessingWorkItem = false; }
 }
        public IEnumerable <TOutput> Process(TInput input)
        {
            foreach (var res in _enveloping.Process(input))
            {
                foreach (var subs in _subscribers)
                {
                    subs.AddData(res);
                }

                yield return(res);
            }
        }