Example #1
0
        internal ZeebeClient(string address,
                             ChannelCredentials credentials,
                             TimeSpan?keepAlive,
                             Func <int, TimeSpan> sleepDurationProvider,
                             ILoggerFactory loggerFactory = null)
        {
            this.loggerFactory = loggerFactory;

            var channelOptions  = new List <ChannelOption>();
            var userAgentString = "client: csharp, version: " + typeof(ZeebeClient).Assembly.GetName().Version;
            var userAgentOption = new ChannelOption(ChannelOptions.PrimaryUserAgentString, userAgentString);

            channelOptions.Add(userAgentOption);

            AddKeepAliveToChannelOptions(channelOptions, keepAlive);

            channelToGateway =
                new Channel(address, credentials, channelOptions);
            gatewayClient = new Gateway.GatewayClient(channelToGateway);


            asyncRetryStrategy =
                new TransientGrpcErrorRetryStrategy(sleepDurationProvider ??
                                                    DefaultWaitTimeProvider);
        }
 public CreateProcessInstanceCommandWithResult(Gateway.GatewayClient client, IAsyncRetryStrategy asyncRetryStrategy, CreateProcessInstanceRequest createRequest)
 {
     this.client             = client;
     createWithResultRequest = new CreateProcessInstanceWithResultRequest {
         Request = createRequest
     };
     this.asyncRetryStrategy = asyncRetryStrategy;
 }
 public CompleteJobCommand(GatewayClient client, IAsyncRetryStrategy asyncRetryStrategy, long jobKey)
 {
     gatewayClient = client;
     request       = new CompleteJobRequest
     {
         JobKey = jobKey
     };
     this.asyncRetryStrategy = asyncRetryStrategy;
 }
Example #4
0
 public CancelWorkflowInstanceCommand(Gateway.GatewayClient client, IAsyncRetryStrategy asyncRetryStrategy, long workflowInstanceKey)
 {
     request = new CancelWorkflowInstanceRequest
     {
         WorkflowInstanceKey = workflowInstanceKey
     };
     this.client             = client;
     this.asyncRetryStrategy = asyncRetryStrategy;
 }
Example #5
0
 public SetVariablesCommand(Gateway.GatewayClient client, IAsyncRetryStrategy asyncRetryStrategy, long elementInstanceKey)
 {
     request = new SetVariablesRequest
     {
         ElementInstanceKey = elementInstanceKey
     };
     this.client             = client;
     this.asyncRetryStrategy = asyncRetryStrategy;
 }
Example #6
0
 public CancelProcessInstanceCommand(Gateway.GatewayClient client, IAsyncRetryStrategy asyncRetryStrategy, long processInstanceKey)
 {
     request = new CancelProcessInstanceRequest
     {
         ProcessInstanceKey = processInstanceKey
     };
     this.client             = client;
     this.asyncRetryStrategy = asyncRetryStrategy;
 }
Example #7
0
 public ThrowErrorCommand(GatewayClient client, IAsyncRetryStrategy asyncRetryStrategy, long jobKey)
 {
     gatewayClient           = client;
     this.asyncRetryStrategy = asyncRetryStrategy;
     request = new ThrowErrorRequest
     {
         JobKey = jobKey
     };
 }
Example #8
0
 public ResolveIncidentCommand(Gateway.GatewayClient client, IAsyncRetryStrategy asyncRetryStrategy, long incidentKey)
 {
     request = new ResolveIncidentRequest
     {
         IncidentKey = incidentKey
     };
     this.client             = client;
     this.asyncRetryStrategy = asyncRetryStrategy;
 }
Example #9
0
 public UpdateRetriesCommand(Gateway.GatewayClient client, IAsyncRetryStrategy asyncRetryStrategy, long jobKey)
 {
     request = new UpdateJobRetriesRequest
     {
         JobKey = jobKey
     };
     this.client             = client;
     this.asyncRetryStrategy = asyncRetryStrategy;
 }
Example #10
0
 public ActivateJobsCommand(GatewayClient client, IAsyncRetryStrategy asyncRetryStrategy)
 {
     this.asyncRetryStrategy = asyncRetryStrategy;
     activator = new JobActivator(client);
     Request   = new ActivateJobsRequest();
 }
Example #11
0
 public DeployProcessCommand(Gateway.GatewayClient client, IAsyncRetryStrategy asyncRetryStrategy)
 {
     gatewayClient           = client;
     this.asyncRetryStrategy = asyncRetryStrategy;
     request = new DeployProcessRequest();
 }
Example #12
0
 public CreateProcessInstanceCommand(Gateway.GatewayClient client, IAsyncRetryStrategy asyncRetryStrategy)
 {
     this.client             = client;
     request                 = new CreateProcessInstanceRequest();
     this.asyncRetryStrategy = asyncRetryStrategy;
 }
Example #13
0
 public TopologyRequestCommand(Gateway.GatewayClient client, IAsyncRetryStrategy asyncRetryStrategy)
 {
     gatewayClient           = client;
     this.asyncRetryStrategy = asyncRetryStrategy;
 }
Example #14
0
 public PublishMessageCommand(GatewayClient client, IAsyncRetryStrategy asyncRetryStrategy)
 {
     gatewayClient           = client;
     request                 = new PublishMessageRequest();
     this.asyncRetryStrategy = asyncRetryStrategy;
 }