pub struct WorkerOptions {
pub max_concurrent_work_items: usize,
pub max_event_names: usize,
pub max_events_per_name: usize,
pub max_pending_tasks_per_name: usize,
pub max_json_payload_size: usize,
pub max_identifier_length: usize,
pub reconnect_policy: ReconnectPolicy,
}Expand description
Configuration options for TaskHubGrpcWorker.
Fields§
§max_concurrent_work_items: usizeMaximum number of concurrent work items (orchestrations + activities) processed simultaneously. The worker stops accepting new work items until an in-flight task completes.
max_event_names: usizeMaximum number of distinct event names that can be buffered per
orchestration. External events arriving before the orchestrator calls
wait_for_external_event are held in a per-name buffer. This cap
limits the number of unique event names to prevent memory exhaustion
from a flood of differently-named events.
max_events_per_name: usizeMaximum number of events buffered per event name. When an external event arrives but no orchestrator is waiting for it yet, the event payload is queued. This cap bounds the queue depth per event name — excess events are discarded with a warning.
max_pending_tasks_per_name: usizeMaximum number of pending wait_for_external_event tasks per event
name. If an orchestrator issues more concurrent waits on the same
event name than this limit, additional waits return an incomplete task.
max_json_payload_size: usizeMaximum JSON payload size in bytes for deserialisation. Payloads exceeding this limit are rejected with an error.
max_identifier_length: usizeMaximum allowed length (in bytes) for identifiers such as orchestrator names, activity names, instance IDs, and event names.
reconnect_policy: ReconnectPolicyReconnection policy applied when the gRPC connection to the sidecar is unavailable or drops. The policy governs both the initial connection attempt and every subsequent reconnect.
Implementations§
Source§impl WorkerOptions
impl WorkerOptions
Sourcepub fn with_max_concurrent_work_items(self, limit: usize) -> Self
pub fn with_max_concurrent_work_items(self, limit: usize) -> Self
Set the maximum number of concurrent work items.
Sourcepub fn with_max_event_names(self, limit: usize) -> Self
pub fn with_max_event_names(self, limit: usize) -> Self
Set the maximum number of distinct event names buffered per orchestration.
Sourcepub fn with_max_events_per_name(self, limit: usize) -> Self
pub fn with_max_events_per_name(self, limit: usize) -> Self
Set the maximum number of events buffered per event name.
Sourcepub fn with_max_pending_tasks_per_name(self, limit: usize) -> Self
pub fn with_max_pending_tasks_per_name(self, limit: usize) -> Self
Set the maximum number of pending wait tasks per event name.
Sourcepub fn with_max_json_payload_size(self, limit: usize) -> Self
pub fn with_max_json_payload_size(self, limit: usize) -> Self
Set the maximum JSON payload size in bytes.
Sourcepub fn with_max_identifier_length(self, limit: usize) -> Self
pub fn with_max_identifier_length(self, limit: usize) -> Self
Set the maximum identifier length in bytes.
Sourcepub fn with_reconnect_policy(self, policy: ReconnectPolicy) -> Self
pub fn with_reconnect_policy(self, policy: ReconnectPolicy) -> Self
Set the reconnect backoff policy.
Sourcepub fn with_fast_reconnect(self) -> Self
pub fn with_fast_reconnect(self) -> Self
Convenience: configure a fast reconnect policy suitable for tests.
Sets a 50 ms initial delay, 500 ms maximum delay, ×2 multiplier, and disables jitter.
Trait Implementations§
Source§impl Clone for WorkerOptions
impl Clone for WorkerOptions
Source§fn clone(&self) -> WorkerOptions
fn clone(&self) -> WorkerOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WorkerOptions
impl Debug for WorkerOptions
Auto Trait Implementations§
impl Freeze for WorkerOptions
impl RefUnwindSafe for WorkerOptions
impl Send for WorkerOptions
impl Sync for WorkerOptions
impl Unpin for WorkerOptions
impl UnsafeUnpin for WorkerOptions
impl UnwindSafe for WorkerOptions
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> 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> 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