Class DelegatingMessageSink<TFinalMessage>
Implementation of IMessageSink that delegates to another implementation of
IMessageSink while calling into an optional callback for each message. In addition,
it issues a Finished event when a message of the type TFinalMessage
is seen and records the final message for later retrieval.
public class DelegatingMessageSink<TFinalMessage> : DelegatingMessageSink, IMessageSink where TFinalMessage : IMessageSinkMessage
Type Parameters
TFinalMessageThe type of the T final message.
- Inheritance
-
DelegatingMessageSink<TFinalMessage>
- Implements
- Inherited Members
Constructors
DelegatingMessageSink(IMessageSink, Action<IMessageSinkMessage>?)
Implementation of IMessageSink that delegates to another implementation of
IMessageSink while calling into an optional callback for each message. In addition,
it issues a Finished event when a message of the type TFinalMessage
is seen and records the final message for later retrieval.
public DelegatingMessageSink(IMessageSink innerSink, Action<IMessageSinkMessage>? callback = null)
Parameters
innerSinkIMessageSinkThe inner message sink.
callbackAction<IMessageSinkMessage>The callback.
Properties
FinalMessage
The final message that was seen that caused Finished to be triggered.
public TFinalMessage FinalMessage { get; }
Property Value
- TFinalMessage
Finished
An event that is triggered when a message of type TFinalMessage is seen.
public ManualResetEvent Finished { get; }
Property Value
Methods
OnMessage(IMessageSinkMessage)
Reports the presence of a message on the message bus. This method should never throw exceptions.
public override bool OnMessage(IMessageSinkMessage message)
Parameters
messageIMessageSinkMessageThe message from the message bus
Returns
- bool
Return
trueto continue running tests, orfalseto stop.