public void ConsumeMessage_Calls_Underlying_Target_Block_Method()
        {
            bool consumed;

            _block.ConsumeMessage(new DataflowMessageHeader(1), _fakeTarget.Object, out consumed);

            _fakeBlock.Verify(b => b.ConsumeMessage(It.IsAny <DataflowMessageHeader>(), It.IsAny <ITargetBlock <int> >(), out consumed), Times.Once());
        }
        public TOut ConsumeMessage(DataflowMessageHeader messageHeader, ITargetBlock <TOut> target, out bool messageConsumed)
        {
            TOut result = _local.ConsumeMessage(messageHeader, target, out messageConsumed);

            lock (_sync)
            {
                Console.ForegroundColor = ConsoleColor.Yellow;
                Console.WriteLine("Consume - {0}: Message Id = {1}, Succeed = {2}, Result = {3}",
                                  Name, messageHeader.Id, messageConsumed, messageConsumed ? result.ToString() : "Not available");
                Console.ResetColor();
            }

            return(result);
        }
Esempio n. 3
0
 PendingImportResourceNewGen ISourceBlock <PendingImportResourceNewGen> .ConsumeMessage(DataflowMessageHeader messageHeader, ITargetBlock <PendingImportResourceNewGen> target, out bool messageConsumed)
 {
     return(OutputBlock.ConsumeMessage(messageHeader, target, out messageConsumed));
 }
 public TOutput ConsumeMessage(DataflowMessageHeader messageHeader, ITargetBlock <TOutput> target, out bool messageConsumed)
 {
     return(_block.ConsumeMessage(messageHeader, target, out messageConsumed));
 }
Esempio n. 5
0
 public SipResponse ConsumeMessage(DataflowMessageHeader messageHeader, ITargetBlock <SipResponse> target, out bool messageConsumed)
 {
     return(responseBuffer.ConsumeMessage(messageHeader, target, out messageConsumed));
 }
 TElement ISourceBlock <TElement> .ConsumeMessage(DataflowMessageHeader messageHeader, ITargetBlock <TElement> target, out bool messageConsumed)
 {
     return(bufferBlock.ConsumeMessage(messageHeader, target, out messageConsumed));
 }
Esempio n. 7
0
 TOutput ISourceBlock <TOutput> .ConsumeMessage(DataflowMessageHeader messageHeader, ITargetBlock <TOutput> target, out bool messageConsumed)
 {
     return(internalBlock.ConsumeMessage(messageHeader, target, out messageConsumed));
 }
Esempio n. 8
0
 T ISourceBlock <T> .ConsumeMessage(DataflowMessageHeader messageHeader, ITargetBlock <T> target,
                                    out bool messageConsumed)
 {
     return(output.ConsumeMessage(messageHeader, target, out messageConsumed));
 }
Esempio n. 9
0
 public string ConsumeMessage(DataflowMessageHeader messageHeader, ITargetBlock <string> target, out bool messageConsumed)
 {
     return(_deadLetter.ConsumeMessage(messageHeader, target, out messageConsumed));
 }
Esempio n. 10
0
 public Ping ConsumeMessage(DataflowMessageHeader messageHeader, ITargetBlock <Ping> target, out bool messageConsumed)
 {
     return(_source.ConsumeMessage(messageHeader, target, out messageConsumed));
 }