pub struct WorkerConfig {
pub host: String,
pub port: u16,
pub tls: bool,
pub cluster: bool,
pub worker_id: WorkerId,
pub worker_instance_id: WorkerInstanceId,
pub namespace: Namespace,
pub lanes: Vec<LaneId>,
pub capabilities: Vec<String>,
pub lease_ttl_ms: u64,
pub claim_poll_interval_ms: u64,
pub max_concurrent_tasks: usize,
}Expand description
Configuration for a FlowFabric worker.
Fields§
§host: StringValkey hostname. Default: "localhost".
port: u16Valkey port. Default: 6379.
tls: boolEnable TLS for the Valkey connection.
cluster: boolEnable Valkey cluster mode.
worker_id: WorkerIdLogical worker identity (e.g., “gpu-worker-pool-1”).
worker_instance_id: WorkerInstanceIdConcrete worker process/runtime instance identity (e.g., container ID).
namespace: NamespaceNamespace this worker operates in.
lanes: Vec<LaneId>Lanes this worker claims work from.
capabilities: Vec<String>Capabilities this worker advertises for routing.
lease_ttl_ms: u64Lease TTL in milliseconds. Default: 30,000 (30s).
claim_poll_interval_ms: u64Interval between claim attempts when idle, in milliseconds. Default: 1,000 (1s).
max_concurrent_tasks: usizeMaximum concurrent tasks. Default: 1.
Implementations§
Source§impl WorkerConfig
impl WorkerConfig
Sourcepub fn new(
host: impl Into<String>,
port: u16,
worker_id: impl Into<String>,
worker_instance_id: impl Into<String>,
namespace: impl Into<String>,
lane: impl Into<String>,
) -> Self
pub fn new( host: impl Into<String>, port: u16, worker_id: impl Into<String>, worker_instance_id: impl Into<String>, namespace: impl Into<String>, lane: impl Into<String>, ) -> Self
Create a minimal config for a single-lane worker.
Sourcepub fn renewal_interval_ms(&self) -> u64
pub fn renewal_interval_ms(&self) -> u64
Lease renewal interval: TTL / 3 (renew at 1/3 of TTL, leaving 2/3 margin).
Auto Trait Implementations§
impl Freeze for WorkerConfig
impl RefUnwindSafe for WorkerConfig
impl Send for WorkerConfig
impl Sync for WorkerConfig
impl Unpin for WorkerConfig
impl UnsafeUnpin for WorkerConfig
impl UnwindSafe for WorkerConfig
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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 more