Exemplo n.º 1
0
            public async Task AddAsync(IStorageQueueMessage message, CancellationToken cancellationToken = default(CancellationToken))
            {
                if (message == null)
                {
                    throw new InvalidOperationException("Cannot enqueue a null queue message instance.");
                }

                await _queue.AddMessageAndCreateIfNotExistsAsync(message, cancellationToken);

                if (_messageEnqueuedWatcher != null)
                {
                    _messageEnqueuedWatcher.Notify(_queue.Name);
                }
            }
Exemplo n.º 2
0
        public async Task SetValueAsync(object value, CancellationToken cancellationToken)
        {
            if (value != null)
            {
                Debug.Assert(value is TInput);
                IStorageQueueMessage message = _converter.Convert((TInput)value);
                Debug.Assert(message != null);
                await _queue.AddMessageAndCreateIfNotExistsAsync(message, cancellationToken);

                if (_messageEnqueuedWatcher != null)
                {
                    _messageEnqueuedWatcher.Notify(_queue.Name);
                }
            }
        }
Exemplo n.º 3
0
 private void OnMessageAddedToPoisonQueue(object sender, PoisonMessageEventArgs e)
 {
     // TODO: this is assuming that the poison queue is in the same
     // storage account
     _sharedWatcher.Notify(e.PoisonQueue.Name);
 }
 private void OnMessageAddedToPoisonQueue(object sender, EventArgs e)
 {
     _sharedWatcher.Notify(_poisonQueue.Name);
 }