Ejemplo n.º 1
0
        public void InitialToClosed()
        {
            var queue = new ScaleoutTaskQueue(new TraceSource("Queue"), "0", new ScaleoutConfiguration()
            {
                RetryOnError = true
            });

            queue.Close();
        }
Ejemplo n.º 2
0
        public void BufferAfterClosedEnqueueThrows()
        {
            var queue = new ScaleoutTaskQueue(new TraceSource("Queue"), "0", new ScaleoutConfiguration()
            {
                RetryOnError = true
            });

            queue.Close();
            queue.SetError(new Exception());
            Assert.Throws <InvalidOperationException>(() => queue.Enqueue(_ => TaskAsyncHelper.Empty, null));
        }
Ejemplo n.º 3
0
        public void SendAfterCloseThenOpenRemainsClosed()
        {
            var queue = new ScaleoutTaskQueue(new TraceSource("Queue"), "0", new ScaleoutConfiguration()
            {
                RetryOnError = true
            });

            queue.Open();
            queue.Enqueue(_ => Task.Delay(50), null);
            queue.Close();
            queue.Open();
            Assert.Throws <InvalidOperationException>(() => queue.Enqueue(_ => TaskAsyncHelper.Empty, null));
        }
Ejemplo n.º 4
0
        public void CloseWhileQueueRuns()
        {
            var queue = new ScaleoutTaskQueue(new TraceSource("Queue"), "0", new ScaleoutConfiguration()
            {
                RetryOnError = true
            });

            queue.Open();
            queue.Enqueue(_ => Task.Delay(50), null);
            queue.Enqueue(_ => Task.Delay(100), null);
            queue.Enqueue(_ => Task.Delay(150), null);
            queue.Close();
        }