pub struct ServerConfig {Show 14 fields
pub host: String,
pub port: u16,
pub tls: bool,
pub cluster: bool,
pub partition_config: PartitionConfig,
pub lanes: Vec<LaneId>,
pub listen_addr: String,
pub engine_config: EngineConfig,
pub skip_library_load: bool,
pub cors_origins: Vec<String>,
pub api_token: Option<String>,
pub waitpoint_hmac_secret: String,
pub waitpoint_hmac_grace_ms: u64,
pub max_concurrent_stream_ops: u32,
}Expand description
Server configuration, loaded from environment variables.
Fields§
§host: StringValkey host. Default: "localhost".
port: u16Valkey port. Default: 6379.
tls: boolEnable TLS for Valkey connections.
cluster: boolEnable Valkey cluster mode.
partition_config: PartitionConfigPartition counts (execution/flow/budget/quota).
lanes: Vec<LaneId>Lanes to manage. Default: ["default"].
listen_addr: StringListen address for the API surface. Default: "0.0.0.0:9090".
engine_config: EngineConfigScanner intervals and engine config.
skip_library_load: boolSkip library loading (for tests where TestCluster already loaded it).
cors_origins: Vec<String>Allowed CORS origins. ["*"] means permissive (all origins).
api_token: Option<String>Shared-secret API token. If set, all requests except GET /healthz must
include Authorization: Bearer <token>. If unset, auth is disabled.
waitpoint_hmac_secret: StringHex-encoded secret used to sign waitpoint HMAC tokens (RFC-004 §Waitpoint Security). Required on boot; the server refuses to start without it so multi-tenant signal authentication is never silently disabled. Recommended length: 64 hex chars (32 bytes).
waitpoint_hmac_grace_ms: u64Grace window during which tokens signed by the previous kid remain accepted after rotation. Tokens already in flight survive operator rotation; operators tighten this for sensitive tenants. Default 24h.
max_concurrent_stream_ops: u32Maximum concurrent stream-op callers (read_attempt_stream +
tail_attempt_stream combined). Each caller holds one semaphore
permit for the duration of its Valkey round-trip(s); contention
surfaces as HTTP 429 at the REST boundary.
Shared bound for both read and tail because both run on the same
dedicated tail_client (see Server.tail_client) — a big
10_000-frame XRANGE reply can head-of-line the mux just as badly
as a long XREAD BLOCK, so they should share fairness accounting.
Default 64. Set below the server’s request-concurrency budget
so stream ops cannot starve other routes. Env var:
FF_MAX_CONCURRENT_STREAM_OPS (preferred) or legacy
FF_MAX_CONCURRENT_TAIL (accepted during the R4 rename; both
valid for at least one release).
Implementations§
Source§impl ServerConfig
impl ServerConfig
Sourcepub fn from_env() -> Result<Self, ConfigError>
pub fn from_env() -> Result<Self, ConfigError>
Load configuration from environment variables.
| Variable | Default | Description |
|---|---|---|
FF_HOST | localhost | Valkey host |
FF_PORT | 6379 | Valkey port |
FF_TLS | false | Enable TLS (1 or true) |
FF_CLUSTER | false | Enable cluster mode (1 or true) |
FF_LISTEN_ADDR | 0.0.0.0:9090 | API listen address |
FF_LANES | default | Comma-separated lane names |
FF_FLOW_PARTITIONS | 256 | Flow partition count — authoritative; under RFC-011 hash-tag co-location, exec keys also route here |
FF_BUDGET_PARTITIONS | 32 | Budget partition count |
FF_QUOTA_PARTITIONS | 32 | Quota partition count |
FF_CORS_ORIGINS | * | Comma-separated CORS origins (* = permissive) |
FF_API_TOKEN | (none) | Shared-secret Bearer token. If set, all non-healthz requests require it. |
FF_LEASE_EXPIRY_INTERVAL_MS | 1500 | Lease expiry scanner interval |
FF_DELAYED_PROMOTER_INTERVAL_MS | 750 | Delayed promoter interval |
FF_INDEX_RECONCILER_INTERVAL_S | 45 | Index reconciler interval |
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ServerConfig
impl RefUnwindSafe for ServerConfig
impl Send for ServerConfig
impl Sync for ServerConfig
impl Unpin for ServerConfig
impl UnsafeUnpin for ServerConfig
impl UnwindSafe for ServerConfig
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> 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 more