public Task<Worker> StartWorkerAsync( string taskList, WorkerOptions options = null, string domain = null )
Public Function StartWorkerAsync ( taskList As String, Optional options As WorkerOptions = Nothing, Optional domain As String = Nothing ) As Task(Of Worker)
public: Task<Worker^>^ StartWorkerAsync( String^ taskList, WorkerOptions^ options = nullptr, String^ domain = nullptr )
member StartWorkerAsync : taskList : string * ?options : WorkerOptions * ?domain : string (* Defaults: let _options = defaultArg options null let _domain = defaultArg domain null *) -> Task<Worker>
|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.
|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.|