AppConfig

Struct AppConfig 

Source
pub struct AppConfig {
Show 13 fields pub snapshot_every: u64, pub max_batch: usize, pub dedup_capacity: usize, pub maintain_views: bool, pub styles: bool, pub share_arrangements: bool, pub columns: bool, pub retention: Retention, pub clock: Arc<dyn Clock>, pub identity: Arc<dyn Identity>, pub quota: Quota, pub presence: Config, pub awareness: Config,
}

Fields§

§snapshot_every: u64

Snapshot the fold every N events. “durable is the entire database administration story”.

§max_batch: usize

Upper bound on group commit: the ingress task drains everything queued up to this many commands and appends their events in one statement. Phase 0 measured 11× for this.

§dedup_capacity: usize

How many recent command ids to remember for idempotency (§4.3).

§maintain_views: bool

Whether a subscription maintains its view by delta rather than recomputing it (§5.3).

On by default, because it is what §3.8 asks for and it is ~5× faster per event. It is a switch rather than a fact because it is also a memory-for-time trade — about 4× the bytes a subscription already held for its page (docs/23-incremental-views-report.md §23.8) — and an operator running a fanout of a hundred thousand idle sessions over a large accumulator should be able to decide that differently without recompiling.

§styles: bool

Whether /beck.css carries the stylesheet the compiler derived from the program’s own classes, or nothing at all (docs/104 §104.4’s styles = none).

On by default, because a page whose classes have no rules behind them is not styled. It is a switch rather than a fact because the sheet is an opinion — a preflight and Tailwind’s design system — and a deployment that ships its own stylesheet should be able to say so without the compiler arguing. Off, beck_core::style still runs and beck explain style still answers; what changes is that nothing is served.

§share_arrangements: bool

Whether the operators that do not read the session are held once for every subscriber rather than once per subscriber (§5.3).

On by default. It costs one lock acquisition per render — a read lock, so subscribers do not block each other — and saves every subscriber the arrangements below the accumulator that are the same computation for all of them. How much that is depends entirely on the program: a view that filters by the session immediately below the fold shares almost nothing, and one that sorts a public feed and personalises only the greeting shares almost everything (docs/23-incremental-views-report.md).

Ignored when maintain_views is off: there are no arrangements to share.

§columns: bool

Whether a list of numbers is held as a column rather than as boxed values ([beck_core::seq], docs/105 §105.10).

On by default, because it halves what a list of numbers occupies and is the only thing in this language a kernel or an Arrow reader can be handed a pointer to. It is a switch rather than a fact for the reason every switch here is one: nothing observable changes — the order, the equality, the digest and the wire bytes are the same either way — so the only thing it can be wrong about is a trade, and a deployment that has measured its own trade should be able to say so without recompiling.

Process-wide, unlike every other field here: a list is built in a hundred places that have no configuration in scope, so App::start applies this to [beck_core::seq::set_columns] rather than carrying it. Two applications in one process therefore share one setting, and the last one started wins — which is stated because it is the one way this field differs from its neighbours.

§retention: Retention

How long the shared dataflow keeps what a subscriber might still ask for.

The default releases the arrangements when the last subscription ends and keeps at most 64 versions of change history while one is open — but what is actually kept is the oldest connected subscriber’s lag, so both numbers are ceilings rather than costs. A deployment whose clients reconnect constantly wants release_when_idle off, and one with slow clients and fast events wants a deeper history; neither should have to recompile for it (docs/23-incremental-views-report.md §23.19 asked for exactly this).

Ignored when share_arrangements is off: there is no shared dataflow to retain anything.

§clock: Arc<dyn Clock>

Where an envelope’s at comes from.

A dependency rather than a tunable, and here because the merge point is “the one place time enters” (§3.7) and this is the configuration the merge point is built from. F11’s constraint is that a clock is supplied and never ambient; beck_core::clock says why, and says what is deliberately not on the seam yet.

§identity: Arc<dyn Identity>

How a claimed identity becomes a verified one.

A dependency rather than a tunable, for the same reason the clock is one, and here because the merge point is where a proposal acquires its actor. DevIdentity by default: beck run on a laptop must not need a secret, and crate::identity is where the consequences of that default are written down.

§quota: Quota

How much one actor may turn into permanent storage — F3’s channel (b).

A tunable rather than a dependency, and on by default, which is what docs/14 F3 decided: a quota a program has to ask for is a quota most programs do not have. crate::quota is the mechanism, the numbers and what the bound is actually worth.

§presence: Config

How large a connection roster this process will hold — D6’s presence signal.

A tunable rather than a dependency, and bounded rather than optional, for the reason crate::presence gives: the roster is keyed by a name the client may choose.

§awareness: Config

How large an awareness roster this process will hold, and how large one contribution may be — the two bounds crate::awareness explains.

Trait Implementations§

Source§

impl Clone for AppConfig

Source§

fn clone(&self) -> AppConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AppConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for AppConfig

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.
§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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