Пример #1
0
        protected System.Threading.Tasks.Task <TResponse> InvokeAsync <TResponse>(
            AmazonWebServiceRequest request,
            InvokeOptionsBase options,
            System.Threading.CancellationToken cancellationToken)
            where TResponse : AmazonWebServiceResponse, new()
        {
            ThrowIfDisposed();

#if AWS_ASYNC_API
            if (cancellationToken == default(CancellationToken))
            {
                cancellationToken = _config.BuildDefaultCancellationToken();
            }
#endif

            var executionContext = new ExecutionContext(
                new RequestContext(this.Config.LogMetrics, Signer)
            {
                ClientConfig      = this.Config,
                Marshaller        = options.RequestMarshaller,
                OriginalRequest   = request,
                Unmarshaller      = options.ResponseUnmarshaller,
                IsAsync           = true,
                CancellationToken = cancellationToken,
                ServiceMetaData   = this.ServiceMetadata,
                Options           = options
            },
                new ResponseContext()
                );
            SetupCSMHandler(executionContext.RequestContext);
            return(this.RuntimePipeline.InvokeAsync <TResponse>(executionContext));
        }