pub struct Engine { /* private fields */ }Expand description
One subscriber’s arrangements over a Prepared plan.
Implementations§
Source§impl Engine
impl Engine
Sourcepub fn new(prepared: Arc<Prepared>) -> Engine
pub fn new(prepared: Arc<Prepared>) -> Engine
A fresh subscriber’s view over a plan the program prepared once, computing every operator itself.
Sourcepub fn subscriber(prepared: Arc<Prepared>) -> Engine
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.
pub fn plan(&self) -> &Arc<Plan>
Sourcepub fn work(&self) -> Work
pub fn work(&self) -> Work
What the last Engine::render cost.
Sourcepub fn arranged(&self) -> u64
pub fn arranged(&self) -> u64
How many entries every arrangement is holding — §5.3’s per-session memory, in the unit that scales.
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.
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Discard everything. The next render rebuilds from the state it is given.
Sourcepub fn render(
&mut self,
state: &Value,
session: &Value,
presence: &Value,
) -> Result<Value, ExecError>
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
impl Engine
Sourcepub fn footprint(&self, base: &Value) -> Footprint
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.