Click or drag to resize

TemporalClientNewWorkerAsync Method

Creates a new Temporal Worker attached to the current client. You'll use this to register your workflow and/or activity implementations with Temporal and the start the worker to signal Temporal that the worker is ready for business.

Namespace:  Neon.Temporal
Assembly:  Neon.Temporal (in Neon.Temporal.dll) Version: 2.14.0-alpha
public Task<Worker> NewWorkerAsync(
	string namespace = null,
	string taskQueue = null,
	WorkerOptions options = null


namespace (Optional)
Type: SystemString
Optionally specifies namespace for worker. Defaults to namespace set in Settings.
taskQueue (Optional)
Type: SystemString
Optionally specifies task queue for worker. Defaults to task queue set in Settings.
options (Optional)
Type: Neon.TemporalWorkerOptions
Optionally specifies additional worker options.

Return Value

Type: TaskWorker
A Worker identifying the worker instance.

Each worker instance will be responsible for actually executing Temporal workflows and activities. Workers are registered within a Temporal namespace and are assigned to a task queue which identifies the virtual queue Temporal uses to schedule work on workers. Workers implementing the same workflows and activities will generally be assigned to the same task queue (which is just an identifying string).

After you have a new worker, you'll need to register workflow and/or activity implementations via RegisterActivityAsyncTActivity(Boolean), RegisterAssemblyActivitiesAsync(Assembly, Boolean), RegisterAssemblyAsync(Assembly, Boolean), or RegisterAssemblyWorkflowsAsync(Assembly, Boolean).

Then after completing the registrations, you'll call StartAsync to start the worker, signalling to Temporal that the worker is ready to execute workflows and activities.

You may call Dispose to explicitly stop a worker or just dispose the TemporalClient which automatically disposes any related workers.

See Also