Ejemplo n.º 1
0
        public static T Timed <TContinuation>(Func <TInput, T> func,
                                              Action <TimedFunc <TInput, T>, TContinuation, T> continuation,
                                              TContinuation continuationValue,
                                              TInput inputValue)
        {
            var timed = new TimedFunc <TInput, T>(new TimeSystem(), func);

            return(timed.Do(continuation, continuationValue, inputValue));
        }
Ejemplo n.º 2
0
        DataflowMessageStatus ITargetBlock <T> .OfferMessage(DataflowMessageHeader messageHeader,
                                                             T messageValue, ISourceBlock <T> source, bool consumeToAccept)
        {
            var t = new TimedFunc <T, DataflowMessageStatus>(_time, v =>
                                                             _base.OfferMessage(messageHeader, messageValue, source, consumeToAccept));

            var status = t.Do((t1, cont, status) => _subject.OnNext(t1), messageValue, messageValue);

            return(status);
        }