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