static async Task Main(string[] args) { using var channel = GrpcChannel.ForAddress("https://localhost:5001"); var client = new Gateway.GatewayClient(channel); Console.Write("Type in your desired date: "); var input = Console.ReadLine(); var date = IsDateValid(input); if (date == null) { throw new ArgumentException("The date must be valid."); } var dateToBeSent = new ZodiacSignsService.Date() { Month = date.Month, Day = date.Day, Year = date.Year }; var reply = await client.ProcessRequestAsync( new GatewayRequest { Date = dateToBeSent });; Console.WriteLine("The zodiac sign associated with that date is " + reply.ZodiacSign); Console.WriteLine("Press any key to exit..."); Console.ReadKey(); }
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, CreateProcessInstanceRequest createRequest) { this.client = client; createWithResultRequest = new CreateProcessInstanceWithResultRequest { Request = createRequest }; }
public ResolveIncidentCommand(Gateway.GatewayClient client, long incidentKey) { request = new ResolveIncidentRequest { IncidentKey = incidentKey }; this.client = client; }
public CancelWorkflowInstanceCommand(Gateway.GatewayClient client, long workflowInstanceKey) { request = new CancelWorkflowInstanceRequest { WorkflowInstanceKey = workflowInstanceKey }; this.client = client; }
public SetVariablesCommand(Gateway.GatewayClient client, long elementInstanceKey) { request = new SetVariablesRequest { ElementInstanceKey = elementInstanceKey }; this.client = client; }
public UpdatePayloadCommand(Gateway.GatewayClient client, long elementInstanceKey) { request = new UpdateWorkflowInstancePayloadRequest { ElementInstanceKey = elementInstanceKey }; this.client = client; }
public CreateProcessInstanceCommandWithResult(Gateway.GatewayClient client, IAsyncRetryStrategy asyncRetryStrategy, CreateProcessInstanceRequest createRequest) { this.client = client; createWithResultRequest = new CreateProcessInstanceWithResultRequest { Request = createRequest }; this.asyncRetryStrategy = asyncRetryStrategy; }
public UpdateRetriesCommand(Gateway.GatewayClient client, long jobKey) { request = new UpdateJobRetriesRequest { JobKey = jobKey }; this.client = client; }
public CancelProcessInstanceCommand(Gateway.GatewayClient client, IAsyncRetryStrategy asyncRetryStrategy, long processInstanceKey) { request = new CancelProcessInstanceRequest { ProcessInstanceKey = processInstanceKey }; this.client = client; this.asyncRetryStrategy = asyncRetryStrategy; }
public JobWorkerBuilder( Gateway.GatewayClient client, IJobClient jobClient, ILoggerFactory loggerFactory = null) { LoggerFactory = loggerFactory; Client = client; JobClient = jobClient; }
public ResolveIncidentCommand(Gateway.GatewayClient client, IAsyncRetryStrategy asyncRetryStrategy, long incidentKey) { request = new ResolveIncidentRequest { IncidentKey = incidentKey }; this.client = client; this.asyncRetryStrategy = asyncRetryStrategy; }
public SetVariablesCommand(Gateway.GatewayClient client, IAsyncRetryStrategy asyncRetryStrategy, long elementInstanceKey) { request = new SetVariablesRequest { ElementInstanceKey = elementInstanceKey }; this.client = client; this.asyncRetryStrategy = asyncRetryStrategy; }
public CancelWorkflowInstanceCommand(Gateway.GatewayClient client, IAsyncRetryStrategy asyncRetryStrategy, long workflowInstanceKey) { request = new CancelWorkflowInstanceRequest { WorkflowInstanceKey = workflowInstanceKey }; this.client = client; this.asyncRetryStrategy = asyncRetryStrategy; }
public UpdateRetriesCommand(Gateway.GatewayClient client, IAsyncRetryStrategy asyncRetryStrategy, long jobKey) { request = new UpdateJobRetriesRequest { JobKey = jobKey }; this.client = client; this.asyncRetryStrategy = asyncRetryStrategy; }
public JobWorkerBuilder(IZeebeClient zeebeClient, Gateway.GatewayClient gatewayClient, ILoggerFactory loggerFactory = null) { LoggerFactory = loggerFactory; Activator = new JobActivator(gatewayClient); Request = new ActivateJobsRequest(); JobClient = zeebeClient; ThreadCount = 1; }
internal JobWorker(Gateway.GatewayClient client, ActivateJobsRequest request, TimeSpan pollInterval, IJobClient jobClient, JobHandler jobHandler) { source = new CancellationTokenSource(); this.client = client; activeRequest = request; this.pollInterval = pollInterval; this.jobClient = jobClient; this.jobHandler = jobHandler; }
public void Dispose() { if (gatewayClient is ClosedGatewayClient) { return; } gatewayClient = new ClosedGatewayClient(); channelToGateway.ShutdownAsync().Wait(); }
internal JobWorker(Gateway.GatewayClient client, ActivateJobsRequest request, TimeSpan pollInterval, IJobClient jobClient, JobHandler jobHandler) { this.source = new CancellationTokenSource(); this.client = client; this.activator = new JobActivator(client); this.activeRequest = request; this.maxJobsActive = request.MaxJobsToActivate; this.pollInterval = pollInterval; this.jobClient = jobClient; this.jobHandler = jobHandler; }
public async Task Connect() { Console.WriteLine("Successfully connected to server."); _messageClient = GrpcServiceProvider.Instance.MessageClient; _gatewayClient = GrpcServiceProvider.Instance.GatewayClient; _clientsUpdatesResponseStream = _gatewayClient.GetClientsUpdates(new Empty()).ResponseStream; _messagesResponseStream = _messageClient.SendMessage().ResponseStream; await Task.WhenAll(ListenToMessages(), ListenToClientsUpdates()); }
internal ZeebeClient(string address, ChannelCredentials credentials, TimeSpan?keepAlive, 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); }
public JobWorkerBuilder(Gateway.GatewayClient client, IJobClient jobClient) { Client = client; JobClient = jobClient; }
public DeployWorkflowCommand(Gateway.GatewayClient client) { gatewayClient = client; request = new DeployWorkflowRequest(); }
public DeployProcessCommand(Gateway.GatewayClient client, IAsyncRetryStrategy asyncRetryStrategy) { gatewayClient = client; this.asyncRetryStrategy = asyncRetryStrategy; request = new DeployProcessRequest(); }
public CreateProcessInstanceCommand(Gateway.GatewayClient client) { this.client = client; request = new CreateProcessInstanceRequest(); }
public DeployProcessCommand(Gateway.GatewayClient client) { gatewayClient = client; request = new DeployProcessRequest(); }
public CreateWorkflowInstanceCommand(Gateway.GatewayClient client) { this.client = client; request = new CreateWorkflowInstanceRequest(); }
private ZeebeClient(string address) { channelToGateway = new Channel(address, ChannelCredentials.Insecure); gatewayClient = new Gateway.GatewayClient(channelToGateway); }
public ListWorkflowRequest(Gateway.GatewayClient client) { this.client = client; request = new ListWorkflowsRequest(); }
internal ZeebeClient(string address, ChannelCredentials credentials, ILoggerFactory loggerFactory = null) { this.loggerFactory = loggerFactory; channelToGateway = new Channel(address, credentials); gatewayClient = new Gateway.GatewayClient(channelToGateway); }