Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        public T Dequeue(TimeSpan timeout)
        {
            T value;

            if (!this.Dequeue(timeout, out value))
            {
                throw Fx.Exception.AsError(new TimeoutException(InternalSR.TimeoutInputQueueDequeue(timeout)));
            }

            return(value);
        }
Exemplo n.º 3
0
        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)));
            }
        }