pub struct WorkerConfigBuilder { /* private fields */ }
Expand description
Builder for WorkerConfig
.
Implementations§
Source§impl WorkerConfigBuilder
impl WorkerConfigBuilder
Sourcepub fn namespace<VALUE>(&mut self, value: VALUE) -> &mut WorkerConfigBuilder
pub fn namespace<VALUE>(&mut self, value: VALUE) -> &mut WorkerConfigBuilder
The Temporal service namespace this worker is bound to
Sourcepub fn task_queue<VALUE>(&mut self, value: VALUE) -> &mut WorkerConfigBuilder
pub fn task_queue<VALUE>(&mut self, value: VALUE) -> &mut WorkerConfigBuilder
What task queue will this worker poll from? This task queue name will be used for both workflow and activity polling.
Sourcepub fn client_identity_override<VALUE>(
&mut self,
value: VALUE,
) -> &mut WorkerConfigBuilder
pub fn client_identity_override<VALUE>( &mut self, value: VALUE, ) -> &mut WorkerConfigBuilder
A human-readable string that can identify this worker. Using something like sdk version and host name is a good default. If set, overrides the identity set (if any) on the client used by this worker.
Sourcepub fn max_cached_workflows<VALUE>(
&mut self,
value: VALUE,
) -> &mut WorkerConfigBuilder
pub fn max_cached_workflows<VALUE>( &mut self, value: VALUE, ) -> &mut WorkerConfigBuilder
If set nonzero, workflows will be cached and sticky task queues will be used, meaning that history updates are applied incrementally to suspended instances of workflow execution. Workflows are evicted according to a least-recently-used policy one the cache maximum is reached. Workflows may also be explicitly evicted at any time, or as a result of errors or failures.
Sourcepub fn tuner(
&mut self,
value: Arc<dyn WorkerTuner + Sync + Send>,
) -> &mut WorkerConfigBuilder
pub fn tuner( &mut self, value: Arc<dyn WorkerTuner + Sync + Send>, ) -> &mut WorkerConfigBuilder
Set a WorkerTuner for this worker. Either this or at least one of the max_outstanding_*
fields must be set.
Sourcepub fn workflow_task_poller_behavior<VALUE>(
&mut self,
value: VALUE,
) -> &mut WorkerConfigBuilderwhere
VALUE: Into<PollerBehavior>,
pub fn workflow_task_poller_behavior<VALUE>(
&mut self,
value: VALUE,
) -> &mut WorkerConfigBuilderwhere
VALUE: Into<PollerBehavior>,
Maximum number of concurrent poll workflow task requests we will perform at a time on this
worker’s task queue. See also WorkerConfig::nonsticky_to_sticky_poll_ratio.
If using SimpleMaximum, Must be at least 2 when max_cached_workflows
> 0, or is an error.
Sourcepub fn nonsticky_to_sticky_poll_ratio<VALUE>(
&mut self,
value: VALUE,
) -> &mut WorkerConfigBuilder
pub fn nonsticky_to_sticky_poll_ratio<VALUE>( &mut self, value: VALUE, ) -> &mut WorkerConfigBuilder
Only applies when using PollerBehavior::SimpleMaximum
(max workflow task polls * this number) = the number of max pollers that will be allowed for the nonsticky queue when sticky tasks are enabled. If both defaults are used, the sticky queue will allow 4 max pollers while the nonsticky queue will allow one. The minimum for either poller is 1, so if the maximum allowed is 1 and sticky queues are enabled, there will be 2 concurrent polls.
Sourcepub fn activity_task_poller_behavior<VALUE>(
&mut self,
value: VALUE,
) -> &mut WorkerConfigBuilderwhere
VALUE: Into<PollerBehavior>,
pub fn activity_task_poller_behavior<VALUE>(
&mut self,
value: VALUE,
) -> &mut WorkerConfigBuilderwhere
VALUE: Into<PollerBehavior>,
Maximum number of concurrent poll activity task requests we will perform at a time on this worker’s task queue
Sourcepub fn nexus_task_poller_behavior<VALUE>(
&mut self,
value: VALUE,
) -> &mut WorkerConfigBuilderwhere
VALUE: Into<PollerBehavior>,
pub fn nexus_task_poller_behavior<VALUE>(
&mut self,
value: VALUE,
) -> &mut WorkerConfigBuilderwhere
VALUE: Into<PollerBehavior>,
Maximum number of concurrent poll nexus task requests we will perform at a time on this worker’s task queue
Sourcepub fn no_remote_activities<VALUE>(
&mut self,
value: VALUE,
) -> &mut WorkerConfigBuilder
pub fn no_remote_activities<VALUE>( &mut self, value: VALUE, ) -> &mut WorkerConfigBuilder
If set to true this worker will only handle workflow tasks and local activities, it will not poll for activity tasks.
Sourcepub fn sticky_queue_schedule_to_start_timeout<VALUE>(
&mut self,
value: VALUE,
) -> &mut WorkerConfigBuilder
pub fn sticky_queue_schedule_to_start_timeout<VALUE>( &mut self, value: VALUE, ) -> &mut WorkerConfigBuilder
How long a workflow task is allowed to sit on the sticky queue before it is timed out and moved to the non-sticky queue where it may be picked up by any worker.
Sourcepub fn max_heartbeat_throttle_interval<VALUE>(
&mut self,
value: VALUE,
) -> &mut WorkerConfigBuilder
pub fn max_heartbeat_throttle_interval<VALUE>( &mut self, value: VALUE, ) -> &mut WorkerConfigBuilder
Longest interval for throttling activity heartbeats
Sourcepub fn default_heartbeat_throttle_interval<VALUE>(
&mut self,
value: VALUE,
) -> &mut WorkerConfigBuilder
pub fn default_heartbeat_throttle_interval<VALUE>( &mut self, value: VALUE, ) -> &mut WorkerConfigBuilder
Default interval for throttling activity heartbeats in case
ActivityOptions.heartbeat_timeout
is unset.
When the timeout is set in the ActivityOptions
, throttling is set to
heartbeat_timeout * 0.8
.
Sourcepub fn max_task_queue_activities_per_second<VALUE>(
&mut self,
value: VALUE,
) -> &mut WorkerConfigBuilder
pub fn max_task_queue_activities_per_second<VALUE>( &mut self, value: VALUE, ) -> &mut WorkerConfigBuilder
Sets the maximum number of activities per second the task queue will dispatch, controlled server-side. Note that this only takes effect upon an activity poll request. If multiple workers on the same queue have different values set, they will thrash with the last poller winning.
Setting this to a nonzero value will also disable eager activity execution.
Sourcepub fn max_worker_activities_per_second<VALUE>(
&mut self,
value: VALUE,
) -> &mut WorkerConfigBuilder
pub fn max_worker_activities_per_second<VALUE>( &mut self, value: VALUE, ) -> &mut WorkerConfigBuilder
Limits the number of activities per second that this worker will process. The worker will not poll for new activities if by doing so it might receive and execute an activity which would cause it to exceed this limit. Negative, zero, or NaN values will cause building the options to fail.
Sourcepub fn ignore_evicts_on_shutdown<VALUE>(
&mut self,
value: VALUE,
) -> &mut WorkerConfigBuilder
pub fn ignore_evicts_on_shutdown<VALUE>( &mut self, value: VALUE, ) -> &mut WorkerConfigBuilder
If set false (default), shutdown will not finish until all pending evictions have been issued and replied to. If set true shutdown will be considered complete when the only remaining work is pending evictions.
This flag is useful during tests to avoid needing to deal with lots of uninteresting evictions during shutdown. Alternatively, if a lang implementation finds it easy to clean up during shutdown, setting this true saves some back-and-forth.
Sourcepub fn fetching_concurrency<VALUE>(
&mut self,
value: VALUE,
) -> &mut WorkerConfigBuilder
pub fn fetching_concurrency<VALUE>( &mut self, value: VALUE, ) -> &mut WorkerConfigBuilder
Maximum number of next page (or initial) history event listing requests we’ll make concurrently. I don’t this it’s worth exposing this to users until we encounter a reason.
Sourcepub fn graceful_shutdown_period<VALUE>(
&mut self,
value: VALUE,
) -> &mut WorkerConfigBuilder
pub fn graceful_shutdown_period<VALUE>( &mut self, value: VALUE, ) -> &mut WorkerConfigBuilder
If set, core will issue cancels for all outstanding activities and nexus operations after shutdown has been initiated and this amount of time has elapsed.
Sourcepub fn local_timeout_buffer_for_activities<VALUE>(
&mut self,
value: VALUE,
) -> &mut WorkerConfigBuilder
pub fn local_timeout_buffer_for_activities<VALUE>( &mut self, value: VALUE, ) -> &mut WorkerConfigBuilder
The amount of time core will wait before timing out activities using its own local timers after one of them elapses. This is to avoid racing with server’s own tracking of the timeout.
Sourcepub fn workflow_failure_errors<VALUE>(
&mut self,
value: VALUE,
) -> &mut WorkerConfigBuilder
pub fn workflow_failure_errors<VALUE>( &mut self, value: VALUE, ) -> &mut WorkerConfigBuilder
Any error types listed here will cause any workflow being processed by this worker to fail, rather than simply failing the workflow task.
Sourcepub fn workflow_types_to_failure_errors<VALUE>(
&mut self,
value: VALUE,
) -> &mut WorkerConfigBuilder
pub fn workflow_types_to_failure_errors<VALUE>( &mut self, value: VALUE, ) -> &mut WorkerConfigBuilder
Like WorkerConfig::workflow_failure_errors, but specific to certain workflow types (the map key).
Sourcepub fn max_outstanding_workflow_tasks<VALUE>(
&mut self,
value: VALUE,
) -> &mut WorkerConfigBuilder
pub fn max_outstanding_workflow_tasks<VALUE>( &mut self, value: VALUE, ) -> &mut WorkerConfigBuilder
The maximum allowed number of workflow tasks that will ever be given to this worker at one
time. Note that one workflow task may require multiple activations - so the WFT counts as
“outstanding” until all activations it requires have been completed. Must be at least 2 if
max_cached_workflows
is > 0, or is an error.
Mutually exclusive with tuner
Sourcepub fn max_outstanding_activities<VALUE>(
&mut self,
value: VALUE,
) -> &mut WorkerConfigBuilder
pub fn max_outstanding_activities<VALUE>( &mut self, value: VALUE, ) -> &mut WorkerConfigBuilder
The maximum number of activity tasks that will ever be given to this worker concurrently
Mutually exclusive with tuner
Sourcepub fn max_outstanding_local_activities<VALUE>(
&mut self,
value: VALUE,
) -> &mut WorkerConfigBuilder
pub fn max_outstanding_local_activities<VALUE>( &mut self, value: VALUE, ) -> &mut WorkerConfigBuilder
The maximum number of local activity tasks that will ever be given to this worker concurrently
Mutually exclusive with tuner
Sourcepub fn max_outstanding_nexus_tasks<VALUE>(
&mut self,
value: VALUE,
) -> &mut WorkerConfigBuilder
pub fn max_outstanding_nexus_tasks<VALUE>( &mut self, value: VALUE, ) -> &mut WorkerConfigBuilder
The maximum number of nexus tasks that will ever be given to this worker concurrently
Mutually exclusive with tuner
Sourcepub fn versioning_strategy<VALUE>(
&mut self,
value: VALUE,
) -> &mut WorkerConfigBuilderwhere
VALUE: Into<WorkerVersioningStrategy>,
pub fn versioning_strategy<VALUE>(
&mut self,
value: VALUE,
) -> &mut WorkerConfigBuilderwhere
VALUE: Into<WorkerVersioningStrategy>,
A versioning strategy for this worker.
Sourcepub fn heartbeat_interval<VALUE>(
&mut self,
value: VALUE,
) -> &mut WorkerConfigBuilder
pub fn heartbeat_interval<VALUE>( &mut self, value: VALUE, ) -> &mut WorkerConfigBuilder
The interval within which the worker will send a heartbeat.
The timer is reset on each existing RPC call that also happens to send this data, like
PollWorkflowTaskQueueRequest
.
Sourcepub fn build(&self) -> Result<WorkerConfig, WorkerConfigBuilderError>
pub fn build(&self) -> Result<WorkerConfig, WorkerConfigBuilderError>
Source§impl WorkerConfigBuilder
impl WorkerConfigBuilder
Sourcepub fn clear_max_outstanding_opts(&mut self) -> &mut WorkerConfigBuilder
pub fn clear_max_outstanding_opts(&mut self) -> &mut WorkerConfigBuilder
Unset all max_outstanding_*
fields
Trait Implementations§
Source§impl Clone for WorkerConfigBuilder
impl Clone for WorkerConfigBuilder
Source§fn clone(&self) -> WorkerConfigBuilder
fn clone(&self) -> WorkerConfigBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Default for WorkerConfigBuilder
impl Default for WorkerConfigBuilder
Source§fn default() -> WorkerConfigBuilder
fn default() -> WorkerConfigBuilder
Auto Trait Implementations§
impl Freeze for WorkerConfigBuilder
impl !RefUnwindSafe for WorkerConfigBuilder
impl Send for WorkerConfigBuilder
impl Sync for WorkerConfigBuilder
impl Unpin for WorkerConfigBuilder
impl !UnwindSafe for WorkerConfigBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request