Zeebe C# Client 2.5.0
C# Client to communicate with an Zeebe Gateway
Loading...
Searching...
No Matches
Zeebe.Client.Api.Worker.IJobWorkerBuilderStep3 Interface Reference

Public Member Functions

IJobWorkerBuilderStep3 Timeout (TimeSpan timeout)
 Set the time for how long a job is exclusively assigned for this worker. More...
 
IJobWorkerBuilderStep3 Name (string workerName)
 Set the name of the worker owner. More...
 
IJobWorkerBuilderStep3 MaxJobsActive (int maxJobsActive)
 Set the maximum number of jobs which will be exclusively activated for this worker at the same time. More...
 
IJobWorkerBuilderStep3 FetchVariables (IList< string > fetchVariables)
 Set a list of variable names which should be fetch on job activation. More...
 
IJobWorkerBuilderStep3 FetchVariables (params string[] fetchVariables)
 Set a list of variable names which should be fetch on job activation. More...
 
IJobWorkerBuilderStep3 PollInterval (TimeSpan pollInterval)
 Set the maximal interval between polling for new jobs. More...
 
IJobWorkerBuilderStep3 PollingTimeout (TimeSpan pollingTimeout)
 Set the polling timeout for the job activation. More...
 
IJobWorkerBuilderStep3 AutoCompletion ()
 Enables job worker auto completion. More...
 
IJobWorkerBuilderStep3 HandlerThreads (byte threadCount)
 Specifies how many handler threads are used by this job worker. More...
 
IJobWorker Open ()
 Open the worker and start to work on available tasks. More...
 

Member Function Documentation

◆ AutoCompletion()

IJobWorkerBuilderStep3 Zeebe.Client.Api.Worker.IJobWorkerBuilderStep3.AutoCompletion ( )

Enables job worker auto completion.

This means if the user does not complete or fails the activated job by himself then the worker will do it.

Returns
the builder for this worker

◆ FetchVariables() [1/2]

IJobWorkerBuilderStep3 Zeebe.Client.Api.Worker.IJobWorkerBuilderStep3.FetchVariables ( IList< string >  fetchVariables)

Set a list of variable names which should be fetch on job activation.

The jobs which are activated by this command will only contain variables from this list.

This can be used to limit the number of variables of the activated jobs.

Parameters
fetchVariableslist of variables names to fetch on activation
Returns
the builder for this worker

◆ FetchVariables() [2/2]

IJobWorkerBuilderStep3 Zeebe.Client.Api.Worker.IJobWorkerBuilderStep3.FetchVariables ( params string[]  fetchVariables)

Set a list of variable names which should be fetch on job activation.

The jobs which are activated by this command will only contain variables from this list.

This can be used to limit the number of variables of the activated jobs.

Parameters
fetchVariableslist of variables names to fetch on activation
Returns
the builder for this worker

◆ HandlerThreads()

IJobWorkerBuilderStep3 Zeebe.Client.Api.Worker.IJobWorkerBuilderStep3.HandlerThreads ( byte  threadCount)

Specifies how many handler threads are used by this job worker.

The previous defined job handler can be called by multiple threads, to execute more jobs concurrently. Per default one job handler thread is used by an job worker. This means the job handler implementation needs to be thread safe.

Note: Job polling is done by a separate thread.

Parameters
threadCounthandler thread count, needs to be larger then zero
Returns
the builder for this worker

◆ MaxJobsActive()

IJobWorkerBuilderStep3 Zeebe.Client.Api.Worker.IJobWorkerBuilderStep3.MaxJobsActive ( int  maxJobsActive)

Set the maximum number of jobs which will be exclusively activated for this worker at the same time.

This is used to control the back pressure of the worker. When the maximum is reached then the worker will stop activating new jobs in order to not overwhelm the client and give other workers the chance to work on the jobs. The worker will try to activate new jobs again when jobs are completed (or marked as failed).

Considerations:

  1. A greater value can avoid situations in which the client waits idle for the broker to provide more jobs. This can improve the worker's throughput.
  2. The memory used by the worker is linear with respect to this value.
  3. The job's timeout starts to run down as soon as the broker pushes the job. Keep in mind that the following must hold to ensure fluent job handling:

    time spent in buffer + time job handler needs until job completion < job timeout
Parameters
maxJobsActivethe maximum jobs active by this worker
Returns
the builder for this worker

◆ Name()

IJobWorkerBuilderStep3 Zeebe.Client.Api.Worker.IJobWorkerBuilderStep3.Name ( string  workerName)

Set the name of the worker owner.

This name is used to identify the worker to which a job is exclusively assigned to.

Parameters
workerNamethe name of the worker (e.g. "payment-service")
Returns
the builder for this worker

◆ Open()

IJobWorker Zeebe.Client.Api.Worker.IJobWorkerBuilderStep3.Open ( )

Open the worker and start to work on available tasks.

Returns
the worker

◆ PollingTimeout()

IJobWorkerBuilderStep3 Zeebe.Client.Api.Worker.IJobWorkerBuilderStep3.PollingTimeout ( TimeSpan  pollingTimeout)

Set the polling timeout for the job activation.

The activate jobs request will be completed when at least one job is activated or after the given requestTimeout.

Parameters
pollingTimeoutthe polling timeout (e.g. "TimeSpan.FromMinutes(10)")
Returns
the builder for this worker

◆ PollInterval()

IJobWorkerBuilderStep3 Zeebe.Client.Api.Worker.IJobWorkerBuilderStep3.PollInterval ( TimeSpan  pollInterval)

Set the maximal interval between polling for new jobs.

A job worker will automatically try to always activate new jobs after completing jobs. If no jobs can be activated after completing the worker will periodically poll for new jobs.

Parameters
pollIntervalthe maximal interval to check for new jobs
Returns
the builder for this worker

◆ Timeout()

IJobWorkerBuilderStep3 Zeebe.Client.Api.Worker.IJobWorkerBuilderStep3.Timeout ( TimeSpan  timeout)

Set the time for how long a job is exclusively assigned for this worker.

In this time, the job can not be assigned by other workers to ensure that only one worker work on the job. When the time is over then the job can be assigned again by this or other worker if it's not completed yet.

Parameters
timeoutthe time as time span (e.g. "TimeSpan.FromMinutes(10)")
Returns
the builder for this worker

The documentation for this interface was generated from the following file: