Class NullChannel
- Namespace
- Steeltoe.Integration.Channel
- Assembly
- Steeltoe.Integration.IntegrationBase.dll
public class NullChannel : Channel<IMessage>, IPollableChannel, IMessageChannel, IServiceNameAware
- Inheritance
-
NullChannel
- Implements
- Inherited Members
Constructors
NullChannel(ILogger)
public NullChannel(ILogger logger = null)
Parameters
logger
ILogger
Properties
ServiceName
public string ServiceName { get; set; }
Property Value
Methods
Receive()
Receive a message from this channel, blocking forever if necessary.
public IMessage Receive()
Returns
- IMessage
the message
Receive(int)
Receive a message from this channel, blocking until either a message is available or the specified timeout period elapses.
public IMessage Receive(int timeout)
Parameters
timeout
intthe timeout value in milliseconds
Returns
- IMessage
the message or null
ReceiveAsync(CancellationToken)
Receive a message from this channel
public ValueTask<IMessage> ReceiveAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokentoken used to signal cancelation
Returns
Send(IMessage)
Send a message to this channel. If the message is sent successfuly, the method returns true. If the message cannot be sent due to a non-fatal reason, the method returns false. The method may also throw a Exception in case of non-recoverable errors. This method may block indefinitely, depending on the implementation.
public bool Send(IMessage message)
Parameters
message
IMessagethe message to send
Returns
- bool
true if the message is sent
Send(IMessage, int)
Send a message, blocking until either the message is accepted or the specified timeout period elapses.
public bool Send(IMessage message, int timeout)
Parameters
Returns
- bool
true if the message is sent
SendAsync(IMessage, CancellationToken)
Send a message to this channel.
public ValueTask<bool> SendAsync(IMessage message, CancellationToken cancellationToken = default)
Parameters
message
IMessagethe message to send
cancellationToken
CancellationTokentoken used to signal cancellation