Example #1
0
        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();
        }
Example #2
0
        public WorkflowMessage Dequeue()
        {
            if (_queue.TryDequeue(out string content))
            {
                return(WorkflowMessage.CreateFrom(this, GetId(), content, null));
            }

            return(null);
        }
Example #3
0
        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));
        }
Example #4
0
        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();
        }
Example #5
0
 public void Complete(WorkflowMessage message)
 {
     // ignore
 }
Example #6
0
 public void UpdateTimeout(WorkflowMessage message, int timeout)
 {
     // ignore
 }
Example #7
0
 public void Enqueue(WorkflowMessage message)
 {
     _queue.Enqueue(message.GetContent());
 }
Example #8
0
 public void Complete(WorkflowMessage message)
 {
     _queue.DeleteMessageAsync(message.Id, message.ReceiptId).Wait();
 }
Example #9
0
        public void Enqueue(WorkflowMessage message)
        {
            var queueMessage = new CloudQueueMessage(message.GetContent());

            _queue.AddMessageAsync(queueMessage).Wait();
        }
Example #10
0
        public void Start(string module, string method, object parameter)
        {
            var message = WorkflowMessage.CreateCall(module, method, parameter);

            _queue.Enqueue(message);
        }