PollAsync Method
PollAsync(TimeSpan)
Tries to dequeue an item.
Declaration
Task<T> PollAsync(TimeSpan timeToWait = default)
Parameters
TimeSpan | timeToWait | How long to wait for an item (-1ms to wait forever; 0ms to not wait at all). |
Returns
Task<T> | The item, or |
Remarks
If an item is not immediately available, this will wait for the specified timeToWait
for an item to become available. If an item does not become available in time, returns null
.
If timeToWait
is -1ms, waits forever. If it is 0ms, does not wait at all.