public async Task <T> DequeueAsync(TimeSpan timeout) { (bool success, T value) = await TryDequeueAsync(timeout); if (!success) { throw Fx.Exception.AsError(new TimeoutException(InternalSR.TimeoutInputQueueDequeue(timeout))); } return(value); }
public T Dequeue(TimeSpan timeout) { T value; if (!this.Dequeue(timeout, out value)) { throw Fx.Exception.AsError(new TimeoutException(InternalSR.TimeoutInputQueueDequeue(timeout))); } return(value); }
public T Dequeue(TimeSpan timeout) { T t = null; if (this.Dequeue(timeout, out t)) { return(t); } else { throw Fx.Exception.AsError(new TimeoutException(InternalSR.TimeoutInputQueueDequeue(timeout))); } }