private IObservable <T> InitializeConsumer()
        {
            _cancel                = new CancellationTokenSource();
            _collection            = new BlockingCollection <T>();
            _undeliverableConsumer = new ActionConsumer <T>(@event => { });

            return(_collection.AsConsumingObservable(_cancel.Token));
        }
        private IObservable <T> InitializeConsumer()
        {
            _cancel     = new CancellationTokenSource();
            _collection = new BlockingCollection <T>();
            var observable = _collection.AsConsumingObservable(_cancel.Token);

            return(observable);
        }
Beispiel #3
0
 public static IObservable <IList <T> > AsBatchingObservable <T>(this BlockingCollection <T> sequence, int n, TimeSpan w, CancellationToken cancellationToken)
 {
     return(sequence.AsConsumingObservable(cancellationToken).Buffer(w, n));
 }
 public CollectionProducer(BlockingCollection <T> collection) : this()
 {
     Background.Produce(collection.AsConsumingObservable(_cancel.Token));
 }