Skip to main content

ServerConfig

Struct ServerConfig 

Source
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: String

Valkey host. Default: "localhost".

§port: u16

Valkey port. Default: 6379.

§tls: bool

Enable TLS for Valkey connections.

§cluster: bool

Enable Valkey cluster mode.

§partition_config: PartitionConfig

Partition counts (execution/flow/budget/quota).

§lanes: Vec<LaneId>

Lanes to manage. Default: ["default"].

§listen_addr: String

Listen address for the API surface. Default: "0.0.0.0:9090".

§engine_config: EngineConfig

Scanner intervals and engine config.

§skip_library_load: bool

Skip 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: String

Hex-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: u64

Grace 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: u32

Maximum 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

Source

pub fn from_env() -> Result<Self, ConfigError>

Load configuration from environment variables.

VariableDefaultDescription
FF_HOSTlocalhostValkey host
FF_PORT6379Valkey port
FF_TLSfalseEnable TLS (1 or true)
FF_CLUSTERfalseEnable cluster mode (1 or true)
FF_LISTEN_ADDR0.0.0.0:9090API listen address
FF_LANESdefaultComma-separated lane names
FF_FLOW_PARTITIONS256Flow partition count — authoritative; under RFC-011 hash-tag co-location, exec keys also route here
FF_BUDGET_PARTITIONS32Budget partition count
FF_QUOTA_PARTITIONS32Quota 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_MS1500Lease expiry scanner interval
FF_DELAYED_PROMOTER_INTERVAL_MS750Delayed promoter interval
FF_INDEX_RECONCILER_INTERVAL_S45Index reconciler interval

Trait Implementations§

Source§

impl Default for ServerConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,