Expand description
Drives one task’s processor graph for an embedder that owns the I/O.
A simulator, a browser playground, or another host that talks to brokers it
controls fetches the source records itself and produces what the graph
emits. EmbeddedTask gives it the same graph that the native runtime’s
stream task runs, instantiated from the same BuiltTopology, so a
topology behaves the same in either. The embedder plays the runtime’s part:
it pipes each fetched record, produces the sink OutputRecords and the
ChangelogRecords, replays a changelog to restore a store, and drives the
punctuation clocks.
Every method is synchronous. The graph’s futures are async because a store
backend may be, but the in-memory backend this module opens never waits, so
each future completes on its first poll and pollster::block_on returns
without parking a thread. That is what lets the type run on
wasm32-unknown-unknown, where no thread can block. A task is
single-threaded: nothing runs in the background, and each method borrows the
task mutably for as long as it drives the graph.
Re-exports§
pub use crate::processor::erased::OutputRecord;
Structs§
- Changelog
Record - One record a state store logged, for the embedder to produce to the changelog topic.
- Embedded
Task - One task’s processor graph, driven by an embedder instead of the runtime.