Engine

Struct Engine 

Source
pub struct Engine { /* private fields */ }
Expand description

One subscriber’s arrangements over a Prepared plan.

Implementations§

Source§

impl Engine

Source

pub fn new(prepared: Arc<Prepared>) -> Engine

A fresh subscriber’s view over a plan the program prepared once, computing every operator itself.

Source

pub fn subscriber(prepared: Arc<Prepared>) -> Engine

A subscriber’s half of a plan whose shared prefix a SharedDataflow maintains.

It owns the per_session operators and nothing else. Rendering it requires the shared side — SharedDataflow::render — because the operators it does not own are where its inputs come from.

Source

pub fn plan(&self) -> &Arc<Plan>

Source

pub fn work(&self) -> Work

What the last Engine::render cost.

Source

pub fn arranged(&self) -> u64

How many entries every arrangement is holding — §5.3’s per-session memory, in the unit that scales.

Source

pub fn arranged_shared(&self) -> u64

The same count, restricted to arrangements that do not read the session.

This is the part §5.3 says a thousand subscribers should hold once between them. A subscriber attached to a SharedDataflow does not own those operators at all, so this is zero for it and the entries are counted once, on SharedDataflow::arranged.

Source

pub fn reset(&mut self)

Discard everything. The next render rebuilds from the state it is given.

Source

pub fn render( &mut self, state: &Value, session: &Value, presence: &Value, ) -> Result<Value, ExecError>

Render this subscriber’s view of a state, maintaining whatever the plan can maintain.

Correct for any state, not only the successor of the last one: an operator that cannot derive a delta rebuilds. That matters because a reconnecting subscriber is rendered against an older state (beck-rt’s resumption path), and an engine that assumed monotonic progress would quietly serve it the wrong page.

Source§

impl Engine

Source

pub fn footprint(&self, base: &Value) -> Footprint

What this subscription retains beyond the accumulator it renders from.

base is that accumulator, and walking it first is not a detail: an arrangement over map_values(s.todos) holds the same Todo records the fold holds, by Arc, so charging a subscription for them would report a row per row where the truth is a handle per row. What remains after the exclusion is what a thousand subscribers actually multiply.

See Footprint for what the number does and does not include.

Trait Implementations§

Source§

impl Drop for Engine

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl Freeze for Engine

§

impl !RefUnwindSafe for Engine

§

impl Send for Engine

§

impl Sync for Engine

§

impl Unpin for Engine

§

impl !UnwindSafe for Engine

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, 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, 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.