public async Task EnqueueAsync(BlobTriggerMessage message, CancellationToken cancellationToken) { string contents = JsonConvert.SerializeObject(message, JsonSerialization.Settings); await _queue.AddMessageAndCreateIfNotExistsAsync(_queue.CreateMessage(contents), cancellationToken); _watcher.Notify(_queue.Name); }
internal async Task EnqueueAsync(JObject data, String functionId, CancellationToken cancellationToken) { string contents = JsonConvert.SerializeObject(new QueueMessage(data, functionId), JsonSerialization.Settings); await _queue.AddMessageAndCreateIfNotExistsAsync(_queue.CreateMessage(contents), cancellationToken); _watcher.Notify(_queue.Name); }
private async Task CopyToPoisonQueueAsync(IStorageQueueMessage message, CancellationToken cancellationToken) { await _poisonQueue.AddMessageAndCreateIfNotExistsAsync(message, cancellationToken); if (_sharedWatcher != null) { _sharedWatcher.Notify(_poisonQueue.Name); } }
public Task AddAsync(T item, CancellationToken cancellationToken) { IStorageQueueMessage message = _converter.Convert(item); if (message == null) { throw new InvalidOperationException("Cannot enqueue a null queue message instance."); } return(_queue.AddMessageAndCreateIfNotExistsAsync(message, cancellationToken)); }
public void Add(T item) { IStorageQueueMessage message = _converter.Convert(item); if (message == null) { throw new InvalidOperationException("Cannot enqueue a null queue message instance."); } _queue.AddMessageAndCreateIfNotExistsAsync(message, CancellationToken.None).GetAwaiter().GetResult(); }
public async Task SetValueAsync(object value, CancellationToken cancellationToken) { IStorageQueueMessage message = _converter.Convert((TInput)value); Debug.Assert(message != null); await _queue.AddMessageAndCreateIfNotExistsAsync(message, cancellationToken); if (_messageEnqueuedWatcher != null) { _messageEnqueuedWatcher.Notify(_queue.Name); } }
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); } }