예제 #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);
        }
예제 #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);
        }
예제 #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)));
            }
        }