Ejemplo n.º 1
0
        internal virtual StartFlowResponse StartFlow(StartFlowRequest request)
        {
            var marshaller   = StartFlowRequestMarshaller.Instance;
            var unmarshaller = StartFlowResponseUnmarshaller.Instance;

            return(Invoke <StartFlowRequest, StartFlowResponse>(request, marshaller, unmarshaller));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initiates the asynchronous execution of the StartFlow operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the StartFlow 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>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/mediaconnect-2018-11-14/StartFlow">REST API Reference for StartFlow Operation</seealso>
        public virtual Task <StartFlowResponse> StartFlowAsync(StartFlowRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = StartFlowRequestMarshaller.Instance;
            var unmarshaller = StartFlowResponseUnmarshaller.Instance;

            return(InvokeAsync <StartFlowRequest, StartFlowResponse>(request, marshaller,
                                                                     unmarshaller, cancellationToken));
        }
        /// <summary>
        /// Initiates the asynchronous execution of the StartFlow operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the StartFlow 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>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/mediaconnect-2018-11-14/StartFlow">REST API Reference for StartFlow Operation</seealso>
        public virtual Task <StartFlowResponse> StartFlowAsync(StartFlowRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = StartFlowRequestMarshaller.Instance;
            options.ResponseUnmarshaller = StartFlowResponseUnmarshaller.Instance;

            return(InvokeAsync <StartFlowResponse>(request, options, cancellationToken));
        }
        internal virtual StartFlowResponse StartFlow(StartFlowRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = StartFlowRequestMarshaller.Instance;
            options.ResponseUnmarshaller = StartFlowResponseUnmarshaller.Instance;

            return(Invoke <StartFlowResponse>(request, options));
        }
        /// <summary>
        /// 此接口用于发起流程
        /// </summary>
        /// <param name="req"><see cref="StartFlowRequest"/></param>
        /// <returns><see cref="StartFlowResponse"/></returns>
        public StartFlowResponse StartFlowSync(StartFlowRequest req)
        {
            JsonResponseModel <StartFlowResponse> rsp = null;

            try
            {
                var strResp = this.InternalRequestSync(req, "StartFlow");
                rsp = JsonConvert.DeserializeObject <JsonResponseModel <StartFlowResponse> >(strResp);
            }
            catch (JsonSerializationException e)
            {
                throw new TencentCloudSDKException(e.Message);
            }
            return(rsp.Response);
        }
 protected async Task TryCreateFlow(string applicationName, FlowInstanceId flowInstanceId, string startedPayload)
 {
     try
     {
         var startRequest = new StartFlowRequest()
         {
             FlowInstanceId = flowInstanceId,
             StartDate      = DateTime.UtcNow,
             UserStarted    = $"{this.GetType().Name} - {flowInstanceId.Id}",
             StartedPayload = startedPayload
         };
         await AsyncActorFlow.CreateFlowAsync(new ActorIdentity(Guid.NewGuid().ToString(), applicationName), flowInstanceId, startRequest, CancellationToken.None);
     }
     catch (Exception ex)
     {
         Logger.LogInformation(ex, $"Failed to create flow to flow service");
     }
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Starts a pre-defined message flow.
 /// </summary>
 /// <returns> StartFlowResponse object</returns>
 /// <param name="request"> StartFlowRequest object</param>
 /// <param name='jsonRpcCallId'>
 /// The json rpc call identifier. This is a string generated by the client, which can be used to correlate the response to the request. Max length is 256 characters. A JSON-RPC id must be generated on a per call invocation basis. The Rogerthat platform uses the id of the call to store the call result for a certain amount of time so that if something fails during the communication, the same call (having the same JSON-RPC id) can be resent to the Rogerthat service, allowing to fetch the result, without actually executing the call again. This avoids annoying problems such as duplicate delivery of messages.
 /// 
 /// You should use a different JSON-RPC id for every call you make.
 /// 
 /// In case of an intermittent failure such as a network connectivity problem, you can retry the same call using the same JSON-RPC id, without running the risk of duplicate execution of your call (e.g. duplicate message delivery).
 /// </param>
 public StartFlowResponse StartFlow(StartFlowRequest request, string jsonRpcCallId)
 {
     StartFlowResponse result = new StartFlowResponse();
     WireRequest(0, jsonRpcCallId, "messaging.start_flow", (writer) =>
         {
             request.Write(writer, false);
         }, (reader) =>
         {
             result.Read(reader);
         }
     );
     return result;
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Starts a pre-defined message flow.
 /// </summary>
 /// <returns> StartFlowResponse object</returns>
 /// <param name="request"> StartFlowRequest object</param>
 public StartFlowResponse StartFlow(StartFlowRequest request)
 {
     return StartFlow(request, Guid.NewGuid().ToString());
 }