Please provide the following methods in IMessageReceiver
:
bool TryReceive(out Message msg, TimeSpan timeout)
Task<bool> TryReceiveAsync(out Message msg, TimeSpan timeout)
So that we can use these like:
if (TryReceive(out Message msg, TimeSpan.FromSeconds(30))
{
...
}
else
{
...
}