/// <summary> /// Initiates the asynchronous execution of the PollForTask operation. /// <seealso cref="Amazon.DataPipeline.IAmazonDataPipeline.PollForTask"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the PollForTask operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public Task<PollForTaskResponse> PollForTaskAsync(PollForTaskRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new PollForTaskRequestMarshaller(); var unmarshaller = PollForTaskResponseUnmarshaller.GetInstance(); return Invoke<IRequest, PollForTaskRequest, PollForTaskResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the PollForTask operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the PollForTask operation on AmazonDataPipelineClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndPollForTask /// operation.</returns> public IAsyncResult BeginPollForTask(PollForTaskRequest request, AsyncCallback callback, object state) { var marshaller = new PollForTaskRequestMarshaller(); var unmarshaller = PollForTaskResponseUnmarshaller.Instance; return BeginInvoke<PollForTaskRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// <para> Task runners call this action to receive a task to perform from AWS Data Pipeline. The task runner specifies which tasks it can /// perform by setting a value for the workerGroup parameter of the PollForTask call. The task returned by PollForTask may come from any of the /// pipelines that match the workerGroup value passed in by the task runner and that was launched using the IAM user credentials specified by /// the task runner. </para> <para> If tasks are ready in the work queue, PollForTask returns a response immediately. If no tasks are available /// in the queue, PollForTask uses long-polling and holds on to a poll connection for up to a 90 seconds during which time the first newly /// scheduled task is handed to the task runner. To accomodate this, set the socket timeout in your task runner to 90 seconds. The task runner /// should not call PollForTask again on the same <c>workerGroup</c> until it receives a response, and this may take up to 90 seconds. </para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the PollForTask service method on /// AmazonDataPipeline.</param> /// /// <returns>The response from the PollForTask service method, as returned by AmazonDataPipeline.</returns> /// /// <exception cref="T:Amazon.DataPipeline.Model.InternalServiceErrorException" /> /// <exception cref="T:Amazon.DataPipeline.Model.InvalidRequestException" /> /// <exception cref="T:Amazon.DataPipeline.Model.TaskNotFoundException" /> public PollForTaskResponse PollForTask(PollForTaskRequest request) { var task = PollForTaskAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// Initiates the asynchronous execution of the PollForTask operation. /// <seealso cref="Amazon.DataPipeline.IAmazonDataPipeline.PollForTask"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the PollForTask operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public async Task<PollForTaskResponse> PollForTaskAsync(PollForTaskRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new PollForTaskRequestMarshaller(); var unmarshaller = PollForTaskResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, PollForTaskRequest, PollForTaskResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
/// <summary> /// Task runners call <code>PollForTask</code> to receive a task to perform from AWS Data /// Pipeline. The task runner specifies which tasks it can perform by setting a value /// for the <code>workerGroup</code> parameter. The task returned can come from any of /// the pipelines that match the <code>workerGroup</code> value passed in by the task /// runner and that was launched using the IAM user credentials specified by the task /// runner. /// /// /// <para> /// If tasks are ready in the work queue, <code>PollForTask</code> returns a response /// immediately. If no tasks are available in the queue, <code>PollForTask</code> uses /// long-polling and holds on to a poll connection for up to a 90 seconds, during which /// time the first newly scheduled task is handed to the task runner. To accomodate this, /// set the socket timeout in your task runner to 90 seconds. The task runner should not /// call <code>PollForTask</code> again on the same <code>workerGroup</code> until it /// receives a response, and this can take up to 90 seconds. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the PollForTask service method.</param> /// /// <returns>The response from the PollForTask service method, as returned by DataPipeline.</returns> /// <exception cref="Amazon.DataPipeline.Model.InternalServiceErrorException"> /// An internal service error occurred. /// </exception> /// <exception cref="Amazon.DataPipeline.Model.InvalidRequestException"> /// The request was not valid. Verify that your request was properly formatted, that the /// signature was generated with the correct credentials, and that you haven't exceeded /// any of the service limits for your account. /// </exception> /// <exception cref="Amazon.DataPipeline.Model.TaskNotFoundException"> /// The specified task was not found. /// </exception> public PollForTaskResponse PollForTask(PollForTaskRequest request) { var marshaller = new PollForTaskRequestMarshaller(); var unmarshaller = PollForTaskResponseUnmarshaller.Instance; return Invoke<PollForTaskRequest,PollForTaskResponse>(request, marshaller, unmarshaller); }
IAsyncResult invokePollForTask(PollForTaskRequest pollForTaskRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new PollForTaskRequestMarshaller().Marshall(pollForTaskRequest); var unmarshaller = PollForTaskResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// <para> Task runners call this action to receive a task to perform from AWS Data Pipeline. The task runner specifies which tasks it can /// perform by setting a value for the workerGroup parameter of the PollForTask call. The task returned by PollForTask may come from any of the /// pipelines that match the workerGroup value passed in by the task runner and that was launched using the IAM user credentials specified by /// the task runner. </para> <para> If tasks are ready in the work queue, PollForTask returns a response immediately. If no tasks are available /// in the queue, PollForTask uses long-polling and holds on to a poll connection for up to a 90 seconds during which time the first newly /// scheduled task is handed to the task runner. To accomodate this, set the socket timeout in your task runner to 90 seconds. The task runner /// should not call PollForTask again on the same <c>workerGroup</c> until it receives a response, and this may take up to 90 seconds. </para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the PollForTask service method on /// AmazonDataPipeline.</param> /// /// <returns>The response from the PollForTask service method, as returned by AmazonDataPipeline.</returns> /// /// <exception cref="T:Amazon.DataPipeline.Model.InternalServiceErrorException" /> /// <exception cref="T:Amazon.DataPipeline.Model.InvalidRequestException" /> /// <exception cref="T:Amazon.DataPipeline.Model.TaskNotFoundException" /> public PollForTaskResponse PollForTask(PollForTaskRequest request) { var task = PollForTaskAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// Initiates the asynchronous execution of the PollForTask operation. /// <seealso cref="Amazon.DataPipeline.IAmazonDataPipeline.PollForTask"/> /// </summary> /// /// <param name="pollForTaskRequest">Container for the necessary parameters to execute the PollForTask operation on AmazonDataPipeline.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndPollForTask /// operation.</returns> public IAsyncResult BeginPollForTask(PollForTaskRequest pollForTaskRequest, AsyncCallback callback, object state) { return invokePollForTask(pollForTaskRequest, callback, state, false); }
/// <summary> /// <para> Task runners call this action to receive a task to perform from AWS Data Pipeline. The task runner specifies which tasks it can /// perform by setting a value for the workerGroup parameter of the PollForTask call. The task returned by PollForTask may come from any of the /// pipelines that match the workerGroup value passed in by the task runner and that was launched using the IAM user credentials specified by /// the task runner. </para> <para> If tasks are ready in the work queue, PollForTask returns a response immediately. If no tasks are available /// in the queue, PollForTask uses long-polling and holds on to a poll connection for up to a 90 seconds during which time the first newly /// scheduled task is handed to the task runner. To accomodate this, set the socket timeout in your task runner to 90 seconds. The task runner /// should not call PollForTask again on the same <c>workerGroup</c> until it receives a response, and this may take up to 90 seconds. </para> /// </summary> /// /// <param name="pollForTaskRequest">Container for the necessary parameters to execute the PollForTask service method on /// AmazonDataPipeline.</param> /// /// <returns>The response from the PollForTask service method, as returned by AmazonDataPipeline.</returns> /// /// <exception cref="InternalServiceErrorException"/> /// <exception cref="InvalidRequestException"/> /// <exception cref="TaskNotFoundException"/> public PollForTaskResponse PollForTask(PollForTaskRequest pollForTaskRequest) { IAsyncResult asyncResult = invokePollForTask(pollForTaskRequest, null, null, true); return EndPollForTask(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the PollForTask operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the PollForTask operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public Task<PollForTaskResponse> PollForTaskAsync(PollForTaskRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new PollForTaskRequestMarshaller(); var unmarshaller = PollForTaskResponseUnmarshaller.Instance; return InvokeAsync<PollForTaskRequest,PollForTaskResponse>(request, marshaller, unmarshaller, cancellationToken); }
private Amazon.DataPipeline.Model.PollForTaskResponse CallAWSServiceOperation(IAmazonDataPipeline client, Amazon.DataPipeline.Model.PollForTaskRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Data Pipeline", "PollForTask"); try { #if DESKTOP return(client.PollForTask(request)); #elif CORECLR return(client.PollForTaskAsync(request).GetAwaiter().GetResult()); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } }
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.DataPipeline.Model.PollForTaskRequest(); if (cmdletContext.Hostname != null) { request.Hostname = cmdletContext.Hostname; } // populate InstanceIdentity var requestInstanceIdentityIsNull = true; request.InstanceIdentity = new Amazon.DataPipeline.Model.InstanceIdentity(); System.String requestInstanceIdentity_instanceIdentity_Document = null; if (cmdletContext.InstanceIdentity_Document != null) { requestInstanceIdentity_instanceIdentity_Document = cmdletContext.InstanceIdentity_Document; } if (requestInstanceIdentity_instanceIdentity_Document != null) { request.InstanceIdentity.Document = requestInstanceIdentity_instanceIdentity_Document; requestInstanceIdentityIsNull = false; } System.String requestInstanceIdentity_instanceIdentity_Signature = null; if (cmdletContext.InstanceIdentity_Signature != null) { requestInstanceIdentity_instanceIdentity_Signature = cmdletContext.InstanceIdentity_Signature; } if (requestInstanceIdentity_instanceIdentity_Signature != null) { request.InstanceIdentity.Signature = requestInstanceIdentity_instanceIdentity_Signature; requestInstanceIdentityIsNull = false; } // determine if request.InstanceIdentity should be set to null if (requestInstanceIdentityIsNull) { request.InstanceIdentity = null; } if (cmdletContext.WorkerGroup != null) { request.WorkerGroup = cmdletContext.WorkerGroup; } CmdletOutput output; // issue call var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; pipelineOutput = cmdletContext.Select(response, this); output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; } catch (Exception e) { output = new CmdletOutput { ErrorResponse = e }; } return(output); }