Documentation

WorkerOptions
in package

Tags
psalm-import-type

DateIntervalValue from DateInterval

Table of Contents

Properties

$enableSessionWorker  : bool
Optional: Enable running session workers.
$maxConcurrentActivityExecutionSize  : int
Optional: To set the maximum concurrent activity executions this worker can have.
$maxConcurrentActivityTaskPollers  : int
Optional: Sets the maximum number of goroutines that will concurrently poll the temporal-server to retrieve activity tasks. Changing this value will affect the rate at which the worker is able to consume tasks from a task queue.
$maxConcurrentLocalActivityExecutionSize  : int
Optional: To set the maximum concurrent local activity executions this worker can have.
$maxConcurrentSessionExecutionSize  : int
Optional: Sets the maximum number of concurrently running sessions the resource support.
$maxConcurrentWorkflowTaskExecutionSize  : int
Optional: To set the maximum concurrent workflow task executions this worker can have.
$maxConcurrentWorkflowTaskPollers  : int
Optional: Sets the maximum number of goroutines that will concurrently poll the temporal-server to retrieve workflow tasks. Changing this value will affect the rate at which the worker is able to consume tasks from a task queue.
$sessionResourceId  : string|null
Optional: The identifier of the resource consumed by sessions.
$stickyScheduleToStartTimeout  : DateInterval|null
Optional: Sticky schedule to start timeout.
$taskQueueActivitiesPerSecond  : float
Optional: Sets the rate limiting on number of activities that can be executed per second.
$workerActivitiesPerSecond  : float
Optional: Sets the rate limiting on number of activities that can be executed per second per worker. This can be used to limit resources used by the worker.
$workerLocalActivitiesPerSecond  : float
Optional: Sets the rate limiting on number of local activities that can be executed per second per worker. This can be used to limit resources used by the worker.
$workerStopTimeout  : DateInterval|null
Optional: worker graceful stop timeout.

Methods

new()  : static
withEnableSessionWorker()  : self
Optional: Enable running session workers.
withMaxConcurrentActivityExecutionSize()  : self
Optional: To set the maximum concurrent activity executions this worker can have.
withMaxConcurrentActivityTaskPollers()  : self
Optional: Sets the maximum number of goroutines that will concurrently poll the temporal-server to retrieve activity tasks. Changing this value will affect the rate at which the worker is able to consume tasks from a task queue.
withMaxConcurrentLocalActivityExecutionSize()  : self
Optional: To set the maximum concurrent local activity executions this worker can have.
withMaxConcurrentSessionExecutionSize()  : self
Optional: Sets the maximum number of concurrently running sessions the resource support.
withMaxConcurrentWorkflowTaskExecutionSize()  : self
Optional: To set the maximum concurrent workflow task executions this worker can have.
withMaxConcurrentWorkflowTaskPollers()  : self
Optional: Sets the maximum number of goroutines that will concurrently poll the temporal-server to retrieve workflow tasks. Changing this value will affect the rate at which the worker is able to consume tasks from a task queue.
withSessionResourceId()  : self
Optional: The identifier of the resource consumed by sessions.
withStickyScheduleToStartTimeout()  : self
Optional: Sticky schedule to start timeout.
withTaskQueueActivitiesPerSecond()  : self
Optional: Sets the rate limiting on number of activities that can be executed per second.
withWorkerActivitiesPerSecond()  : self
Optional: Sets the rate limiting on number of activities that can be executed per second per worker. This can be used to limit resources used by the worker.
withWorkerLocalActivitiesPerSecond()  : self
Optional: Sets the rate limiting on number of local activities that can be executed per second per worker. This can be used to limit resources used by the worker.
withWorkerStopTimeout()  : self
Optional: worker graceful stop timeout.

Properties

$enableSessionWorker

Optional: Enable running session workers.

public bool $enableSessionWorker = false

Session workers is for activities within a session. Enable this option to allow worker to process sessions.

$maxConcurrentActivityExecutionSize

Optional: To set the maximum concurrent activity executions this worker can have.

public int $maxConcurrentActivityExecutionSize = 0

The zero value of this uses the default value.

$maxConcurrentActivityTaskPollers

Optional: Sets the maximum number of goroutines that will concurrently poll the temporal-server to retrieve activity tasks. Changing this value will affect the rate at which the worker is able to consume tasks from a task queue.

public int $maxConcurrentActivityTaskPollers = 0

$maxConcurrentLocalActivityExecutionSize

Optional: To set the maximum concurrent local activity executions this worker can have.

public int $maxConcurrentLocalActivityExecutionSize = 0

The zero value of this uses the default value.

$maxConcurrentSessionExecutionSize

Optional: Sets the maximum number of concurrently running sessions the resource support.

public int $maxConcurrentSessionExecutionSize = 1000

$maxConcurrentWorkflowTaskExecutionSize

Optional: To set the maximum concurrent workflow task executions this worker can have.

public int $maxConcurrentWorkflowTaskExecutionSize = 0

The zero value of this uses the default value.

$maxConcurrentWorkflowTaskPollers

Optional: Sets the maximum number of goroutines that will concurrently poll the temporal-server to retrieve workflow tasks. Changing this value will affect the rate at which the worker is able to consume tasks from a task queue.

public int $maxConcurrentWorkflowTaskPollers = 0

$sessionResourceId

Optional: The identifier of the resource consumed by sessions.

public string|null $sessionResourceId = null

It's the user's responsibility to ensure there's only one worker using this resourceID.

For now, if user doesn't specify one, a new uuid will be used as the resourceID.

$stickyScheduleToStartTimeout

Optional: Sticky schedule to start timeout.

public DateInterval|null $stickyScheduleToStartTimeout = null

The resolution is seconds. See details about StickyExecution on the comments for DisableStickyExecution.

$taskQueueActivitiesPerSecond

Optional: Sets the rate limiting on number of activities that can be executed per second.

public float $taskQueueActivitiesPerSecond = 0

This is managed by the server and controls activities per second for your entire taskqueue whereas WorkerActivityTasksPerSecond controls activities only per worker.

Notice that the number is represented in float, so that you can set it to less than 1 if needed. For example, set the number to 0.1 means you want your activity to be executed once for every 10 seconds. This can be used to protect down stream services from flooding.

The zero value of this uses the default value.

$workerActivitiesPerSecond

Optional: Sets the rate limiting on number of activities that can be executed per second per worker. This can be used to limit resources used by the worker.

public float $workerActivitiesPerSecond = 0

Notice that the number is represented in float, so that you can set it to less than 1 if needed. For example, set the number to 0.1 means you want your activity to be executed once for every 10 seconds. This can be used to protect down stream services from flooding. The zero value of this uses the default value.

$workerLocalActivitiesPerSecond

Optional: Sets the rate limiting on number of local activities that can be executed per second per worker. This can be used to limit resources used by the worker.

public float $workerLocalActivitiesPerSecond = 0

Notice that the number is represented in float, so that you can set it to less than 1 if needed. For example, set the number to 0.1 means you want your local activity to be executed once for every 10 seconds. This can be used to protect down stream services from flooding.

The zero value of this uses the default value.

$workerStopTimeout

Optional: worker graceful stop timeout.

public DateInterval|null $workerStopTimeout = null

Methods

withEnableSessionWorker()

Optional: Enable running session workers.

public withEnableSessionWorker([bool $enable = true ]) : self

Session workers is for activities within a session. Enable this option to allow worker to process sessions.

Parameters
$enable : bool = true
Return values
self

withMaxConcurrentActivityExecutionSize()

Optional: To set the maximum concurrent activity executions this worker can have.

public withMaxConcurrentActivityExecutionSize(int<0, max> $size) : self

The zero value of this uses the default value.

Parameters
$size : int<0, max>
Tags
psalm-suppress

ImpureMethodCall

Return values
self

withMaxConcurrentActivityTaskPollers()

Optional: Sets the maximum number of goroutines that will concurrently poll the temporal-server to retrieve activity tasks. Changing this value will affect the rate at which the worker is able to consume tasks from a task queue.

public withMaxConcurrentActivityTaskPollers(int<0, max> $pollers) : self
Parameters
$pollers : int<0, max>
Tags
psalm-suppress

ImpureMethodCall

Return values
self

withMaxConcurrentLocalActivityExecutionSize()

Optional: To set the maximum concurrent local activity executions this worker can have.

public withMaxConcurrentLocalActivityExecutionSize(int<0, max> $size) : self

The zero value of this uses the default value.

Parameters
$size : int<0, max>
Tags
psalm-suppress

ImpureMethodCall

Return values
self

withMaxConcurrentSessionExecutionSize()

Optional: Sets the maximum number of concurrently running sessions the resource support.

public withMaxConcurrentSessionExecutionSize(int<0, max> $size) : self
Parameters
$size : int<0, max>
Tags
psalm-suppress

ImpureMethodCall

Return values
self

withMaxConcurrentWorkflowTaskExecutionSize()

Optional: To set the maximum concurrent workflow task executions this worker can have.

public withMaxConcurrentWorkflowTaskExecutionSize(int<0, max> $size) : self

The zero value of this uses the default value.

Parameters
$size : int<0, max>
Tags
psalm-suppress

ImpureMethodCall

Return values
self

withMaxConcurrentWorkflowTaskPollers()

Optional: Sets the maximum number of goroutines that will concurrently poll the temporal-server to retrieve workflow tasks. Changing this value will affect the rate at which the worker is able to consume tasks from a task queue.

public withMaxConcurrentWorkflowTaskPollers(int<0, max> $pollers) : self
Parameters
$pollers : int<0, max>
Tags
psalm-suppress

ImpureMethodCall

Return values
self

withSessionResourceId()

Optional: The identifier of the resource consumed by sessions.

public withSessionResourceId(string|null $identifier) : self

It's the user's responsibility to ensure there's only one worker using this resourceID.

For now, if user doesn't specify one, a new uuid will be used as the resourceID.

Parameters
$identifier : string|null
Return values
self

withStickyScheduleToStartTimeout()

Optional: Sticky schedule to start timeout.

public withStickyScheduleToStartTimeout(DateIntervalValue $timeout) : self

The resolution is seconds. See details about StickyExecution on the comments for DisableStickyExecution.

Parameters
$timeout : DateIntervalValue
Tags
psalm-suppress

ImpureMethodCall

Return values
self

withTaskQueueActivitiesPerSecond()

Optional: Sets the rate limiting on number of activities that can be executed per second.

public withTaskQueueActivitiesPerSecond(float $interval) : self

This is managed by the server and controls activities per second for your entire taskqueue whereas WorkerActivityTasksPerSecond controls activities only per worker.

Notice that the number is represented in float, so that you can set it to less than 1 if needed. For example, set the number to 0.1 means you want your activity to be executed once for every 10 seconds. This can be used to protect down stream services from flooding.

The zero value of this uses the default value.

Parameters
$interval : float
Tags
psalm-suppress

ImpureMethodCall

Return values
self

withWorkerActivitiesPerSecond()

Optional: Sets the rate limiting on number of activities that can be executed per second per worker. This can be used to limit resources used by the worker.

public withWorkerActivitiesPerSecond(float $interval) : self

Notice that the number is represented in float, so that you can set it to less than 1 if needed. For example, set the number to 0.1 means you want your activity to be executed once for every 10 seconds. This can be used to protect down stream services from flooding. The zero value of this uses the default value.

Parameters
$interval : float
Tags
psalm-suppress

ImpureMethodCall

Return values
self

withWorkerLocalActivitiesPerSecond()

Optional: Sets the rate limiting on number of local activities that can be executed per second per worker. This can be used to limit resources used by the worker.

public withWorkerLocalActivitiesPerSecond(float $interval) : self

Notice that the number is represented in float, so that you can set it to less than 1 if needed. For example, set the number to 0.1 means you want your local activity to be executed once for every 10 seconds. This can be used to protect down stream services from flooding.

The zero value of this uses the default value.

Parameters
$interval : float
Tags
psalm-suppress

ImpureMethodCall

Return values
self

withWorkerStopTimeout()

Optional: worker graceful stop timeout.

public withWorkerStopTimeout(DateIntervalValue $timeout) : self
Parameters
$timeout : DateIntervalValue
Tags
psalm-suppress

ImpureMethodCall

Return values
self

        
On this page

Search results