Exemplo n.º 1
0
        private async Task <ActivityTask> PollAmazonSwfForActivityTaskAsync(TaskList taskList, string pollingIdentity, CancellationToken cancellationToken)
        {
            var request  = taskList.ActivityTaskPollingRequest(_name, pollingIdentity);
            var response = await _simpleWorkflowClient.PollForActivityTaskAsync(request, cancellationToken);

            return(response?.ActivityTask);
        }
 private async Task <PollForActivityTaskResponse> PollForActivityTaskAsync(string domain, string taskList, string workerId)
 {
     return(await _workflow.PollForActivityTaskAsync(new PollForActivityTaskRequest
     {
         Domain = domain,
         Identity = workerId,
         TaskList = new TaskList
         {
             Name = taskList
         }
     }));
 }
Exemplo n.º 3
0
        /// <summary>
        /// Poll the image processing activity task list to see if work needs to be done.
        /// </summary>
        /// <returns></returns>
        private async Task <ActivityTask> PollAsync()
        {
            PollForActivityTaskRequest request = new PollForActivityTaskRequest
            {
                Domain   = _Domain,
                TaskList = new TaskList()
                {
                    Name = _TaskList
                }
            };

            Logger.Debug("TaskList: {0}", request.TaskList.Name);

            PollForActivityTaskResponse response = await _swfClient.PollForActivityTaskAsync(request, _cancellationToken);

            return(response.ActivityTask);
        }