Click or drag to resize

CadenceClientStartWorkerAsync Method

Signals Cadence that the application is capable of executing workflows and/or activities for a specific domain and task list.

Namespace:  Neon.Cadence
Assembly:  Neon.Cadence (in Neon.Cadence.dll) Version: 2.14.0
public Task<Worker> StartWorkerAsync(
	string taskList,
	WorkerOptions options = null,
	string domain = null


Type: SystemString
Specifies the task list implemented by the worker. This must not be empty.
options (Optional)
Type: Neon.CadenceWorkerOptions
Optionally specifies additional worker options.
domain (Optional)
Type: SystemString
Optionally overrides the default CadenceClient domain.

Return Value

Type: TaskWorker
A Worker identifying the worker instance.
ArgumentNullExceptionThrown if taskList is null or empty.
InvalidOperationException Thrown when an attempt is made to recreate a worker with the same properties on a given client. See the note in the remarks.
Note Note
CadenceClient for more information on task lists.

Your workflow application will need to call this method so that Cadence will know that it can schedule activities to run within the current process. You'll need to specify the target Cadence domain and task list.

You may also specify an optional WorkerOptions parameter as well as customize the name used to register the activity, which defaults to the fully qualified name of the activity type.

This method returns a Worker which implements IDisposable. It's a best practice to call Dispose just before the a worker process terminates, but this is optional. Advanced worker implementation that need to change their configuration over time can also call Dispose to stop workers for specific domains and task lists.

Note Note
The Cadence GOLANG client does not appear to support starting a worker with a given set of parameters, stopping that workflow, and then restarting another worker with the same parameters on the same client. This method detects this situation and throws an InvalidOperationException when a restart is attempted.
See Also