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