public void UpdateTimeout(WorkflowMessage message, int timeout) { var cloudMessage = new CloudQueueMessage(message.Id, message.ReceiptId); var visibilityTimeout = TimeSpan.FromSeconds(timeout); _queue.UpdateMessageAsync(cloudMessage, visibilityTimeout, MessageUpdateFields.Visibility).Wait(); }
public WorkflowMessage Dequeue() { if (_queue.TryDequeue(out string content)) { return(WorkflowMessage.CreateFrom(this, GetId(), content, null)); } return(null); }
public WorkflowMessage Dequeue() { TimeSpan visibility = TimeSpan.FromSeconds(5); var queueMessage = _queue.GetMessageAsync(visibility, null, null).Result; if (queueMessage == null) { return(null); } return(WorkflowMessage.CreateFrom(this, queueMessage.Id, queueMessage.AsString, queueMessage.PopReceipt)); }
protected virtual void ProcessMessage(WorkflowMessage message) { if (message == null) { throw new ArgumentNullException(nameof(message)); } int timeout = GetModuleTimeout(message.Module); message.UpdateTimeout(timeout); RunLocal(message.Module, message.Method, message.Parameter); message.Complete(); }
public void Complete(WorkflowMessage message) { // ignore }
public void UpdateTimeout(WorkflowMessage message, int timeout) { // ignore }
public void Enqueue(WorkflowMessage message) { _queue.Enqueue(message.GetContent()); }
public void Complete(WorkflowMessage message) { _queue.DeleteMessageAsync(message.Id, message.ReceiptId).Wait(); }
public void Enqueue(WorkflowMessage message) { var queueMessage = new CloudQueueMessage(message.GetContent()); _queue.AddMessageAsync(queueMessage).Wait(); }
public void Start(string module, string method, object parameter) { var message = WorkflowMessage.CreateCall(module, method, parameter); _queue.Enqueue(message); }