Class AbstractMessageReceivingTemplate<D>
public abstract class AbstractMessageReceivingTemplate<D> : AbstractMessageSendingTemplate<D>, IMessageSendingOperations<D>, IMessageReceivingOperations<D>
Type Parameters
D
- Inheritance
-
AbstractMessageReceivingTemplate<D>
- Implements
- Derived
- Inherited Members
Properties
DefaultReceiveDestination
public virtual D DefaultReceiveDestination { get; set; }
Property Value
- D
RequiredDefaultReceiveDestination
protected virtual D RequiredDefaultReceiveDestination { get; }
Property Value
- D
ThrowReceivedExceptions
public virtual bool ThrowReceivedExceptions { get; set; }
Property Value
Methods
DoConvert<T>(IMessage)
protected virtual T DoConvert<T>(IMessage message)
Parameters
message
IMessage
Returns
- T
Type Parameters
T
DoReceive(D)
protected abstract IMessage DoReceive(D destination)
Parameters
destination
D
Returns
DoReceiveAsync(D, CancellationToken)
protected abstract Task<IMessage> DoReceiveAsync(D destination, CancellationToken cancellationToken)
Parameters
destination
DcancellationToken
CancellationToken
Returns
Receive()
Receive a message from a default destination
public virtual IMessage Receive()
Returns
- IMessage
the received message; or null
Receive(D)
Receive a message from the given destination
public virtual IMessage Receive(D destination)
Parameters
destination
Dthe target destination
Returns
- IMessage
the received message; or null
ReceiveAndConvertAsync<T>(CancellationToken)
Receive a message from a default destination and convert its payload to the specified target type.
public virtual Task<T> ReceiveAndConvertAsync<T>(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokentoken used to signal cancelation
Returns
- Task<T>
a task to signal completion
Type Parameters
T
the type of the payload
ReceiveAndConvertAsync<T>(D, CancellationToken)
Receive a message from the given destination and convert its payload to the specified target type.
public virtual Task<T> ReceiveAndConvertAsync<T>(D destination, CancellationToken cancellationToken = default)
Parameters
destination
Dthe target destination
cancellationToken
CancellationTokentoken used to signal cancelation
Returns
- Task<T>
a task to signal completion
Type Parameters
T
the type of the payload
ReceiveAndConvert<T>()
Receive a message from a default destination and convert its payload to the specified target type.
public virtual T ReceiveAndConvert<T>()
Returns
- T
the received message; or null
Type Parameters
T
the type of the payload
ReceiveAndConvert<T>(D)
Receive a message from the given destination and convert its payload to the specified target type.
public virtual T ReceiveAndConvert<T>(D destination)
Parameters
destination
Dthe target destination
Returns
- T
the received message; or null
Type Parameters
T
the type of the payload
ReceiveAsync(CancellationToken)
Receive a message from a default destination
public virtual Task<IMessage> ReceiveAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokentoken used to signal cancelation
Returns
ReceiveAsync(D, CancellationToken)
Receive a message from the given destination
public virtual Task<IMessage> ReceiveAsync(D destination, CancellationToken cancellationToken = default)
Parameters
destination
Dthe target destination
cancellationToken
CancellationTokentoken used to signal cancelation