~/bend-docscommunity

machine_stream.bend checks

raw source on the hub · import bendvy-ecs-core@0.1.0.2/machine_stream.bend as Machine_stream

4 imports
import Base
import machine.bend as M
import event_runtime.bend as Ev
import machine_stream_queue.bend as Q

Types

type Stream source · line 7 · raw

@V:Data -> Data

FIFO metadata: front oldest-first, back newest-first; size counts events.

type Reader source · line 9 · raw

@S:Data -> @M:Data -> Type

type OpenResult source · line 79 · raw

@S:Data -> @M:Data -> @V:Data -> Type

Engine entry points consume and return the real affine reader capability. A foreign-world refusal preserves both owners and never activates a cursor.

Templates

template empty source · line 12 · raw

@-V:Data -> Stream<V>

template publish source · line 13 · raw

@-V:Data -> @stream:Stream<V> -> @tick:Nat -> @event:0xb2b0f04555daca474f0f77d0966945c9/machine.Transition<V> -> Stream<V>

template activate source · line 16 · raw

@-V:Data -> @stream:Stream<V> -> @id:U32 -> @tick:Nat -> Stream<V>

template complete source · line 19 · raw

@-V:Data -> @stream:Stream<V> -> @id:U32 -> @tick:Nat -> @success:Bool -> Stream<V>

template skip source · line 24 · raw

@-V:Data -> @stream:Stream<V> -> @id:U32 -> @tick:Nat -> Stream<V>

A condition-false system never executes its reader parameter.

template initial_queue source · line 28 · raw

@-V:Data -> @queue:0xb2b0f04555daca474f0f77d0966945c9/machine_stream_queue.Queue<0xb2b0f04555daca474f0f77d0966945c9/machine.Transition<V>> -> @tick:Nat -> @value:V -> 0xb2b0f04555daca474f0f77d0966945c9/machine_stream_queue.Queue<0xb2b0f04555daca474f0f77d0966945c9/machine.Transition<V>>

Bevy insert_state replaces messages while preserving reader positions and loss.

template initial source · line 31 · raw

@-V:Data -> @stream:Stream<V> -> @tick:Nat -> @value:V -> Stream<V>

template observe_position source · line 35 · raw

@-V:Data -> @position:Maybe<&1, 0xb2b0f04555daca474f0f77d0966945c9/event_runtime.Position> -> @batches:List<&2, 0xb2b0f04555daca474f0f77d0966945c9/event_runtime.Batch<0xb2b0f04555daca474f0f77d0966945c9/machine.Transition<V>>> -> @dropped:Nat -> @id:U32 -> @tick:Nat -> 0xb2b0f04555daca474f0f77d0966945c9/event_runtime.Reading<0xb2b0f04555daca474f0f77d0966945c9/machine.Transition<V>>

template observe_registered source · line 40 · raw

@-V:Data -> @position:0xb2b0f04555daca474f0f77d0966945c9/event_runtime.Position -> @+queue:0xb2b0f04555daca474f0f77d0966945c9/machine_stream_queue.Queue<0xb2b0f04555daca474f0f77d0966945c9/machine.Transition<V>> -> 0xb2b0f04555daca474f0f77d0966945c9/event_runtime.Reading<0xb2b0f04555daca474f0f77d0966945c9/machine.Transition<V>>

template observe_queue_position source · line 43 · raw

@-V:Data -> @position:Maybe<&1, 0xb2b0f04555daca474f0f77d0966945c9/event_runtime.Position> -> @queue:0xb2b0f04555daca474f0f77d0966945c9/machine_stream_queue.Queue<0xb2b0f04555daca474f0f77d0966945c9/machine.Transition<V>> -> @id:U32 -> @tick:Nat -> 0xb2b0f04555daca474f0f77d0966945c9/event_runtime.Reading<0xb2b0f04555daca474f0f77d0966945c9/machine.Transition<V>>

template observe source · line 47 · raw

@-V:Data -> @stream:Stream<V> -> @+id:U32 -> @tick:Nat -> 0xb2b0f04555daca474f0f77d0966945c9/event_runtime.Reading<0xb2b0f04555daca474f0f77d0966945c9/machine.Transition<V>>

template batches_into_queue source · line 50 · raw

@-V:Data -> @batches:List<&2, 0xb2b0f04555daca474f0f77d0966945c9/event_runtime.Batch<0xb2b0f04555daca474f0f77d0966945c9/machine.Transition<V>>> -> @queue:0xb2b0f04555daca474f0f77d0966945c9/machine_stream_queue.Queue<0xb2b0f04555daca474f0f77d0966945c9/machine.Transition<V>> -> 0xb2b0f04555daca474f0f77d0966945c9/machine_stream_queue.Queue<0xb2b0f04555daca474f0f77d0966945c9/machine.Transition<V>>

template trimmed source · line 54 · raw

@-V:Data -> @frameStart:Nat -> @positions:List<&2, 0xb2b0f04555daca474f0f77d0966945c9/event_runtime.Position> -> @result:0xb2b0f04555daca474f0f77d0966945c9/event_runtime.Trimmed<0xb2b0f04555daca474f0f77d0966945c9/machine.Transition<V>> -> Stream<V>

template frame source · line 58 · raw

@-V:Data -> @stream:Stream<V> -> @tick:Nat -> Stream<V>

template dispose source · line 61 · raw

@-V:Data -> @stream:Stream<V> -> @id:U32 -> Stream<V>

template batches_loop source · line 66 · raw

@-V:Data -> @batches:List<&2, 0xb2b0f04555daca474f0f77d0966945c9/machine_stream_queue.Batch<0xb2b0f04555daca474f0f77d0966945c9/machine.Transition<V>>> -> @acc:List<&2, 0xb2b0f04555daca474f0f77d0966945c9/event_runtime.Batch<0xb2b0f04555daca474f0f77d0966945c9/machine.Transition<V>>> -> List<&2, 0xb2b0f04555daca474f0f77d0966945c9/event_runtime.Batch<0xb2b0f04555daca474f0f77d0966945c9/machine.Transition<V>>>

Canonical snapshot includes every retained batch/payload, without changing cursor.

template snapshot_queue source · line 70 · raw

@-V:Data -> @queue:0xb2b0f04555daca474f0f77d0966945c9/machine_stream_queue.Queue<0xb2b0f04555daca474f0f77d0966945c9/machine.Transition<V>> -> @positions:List<&2, 0xb2b0f04555daca474f0f77d0966945c9/event_runtime.Position> -> @frameStart:Nat -> Pair(List<&2, 0xb2b0f04555daca474f0f77d0966945c9/event_runtime.Batch<0xb2b0f04555daca474f0f77d0966945c9/machine.Transition<V>>>, Pair(List<&2, 0xb2b0f04555daca474f0f77d0966945c9/event_runtime.Position>, Pair(Nat, Nat)))

template snapshot source · line 73 · raw

@-V:Data -> @stream:Stream<V> -> Pair(List<&2, 0xb2b0f04555daca474f0f77d0966945c9/event_runtime.Batch<0xb2b0f04555daca474f0f77d0966945c9/machine.Transition<V>>>, Pair(List<&2, 0xb2b0f04555daca474f0f77d0966945c9/event_runtime.Position>, Pair(Nat, Nat)))

template open_checked source · line 83 · raw

@-S:Data -> @-M:Data -> @-V:Data -> @allowed:Bool -> @reader:Reader<S, M> -> @+stream:Stream<V> -> @+tick:Nat -> OpenResult<S, M, V>

template open source · line 89 · raw

@-S:Data -> @-M:Data -> @-V:Data -> @reader:Reader<S, M> -> @stream:Stream<V> -> @namespace:U32 -> @tick:Nat -> OpenResult<S, M, V>

template finish source · line 93 · raw

@-S:Data -> @-M:Data -> @-V:Data -> @reader:Reader<S, M> -> @stream:Stream<V> -> @tick:Nat -> @success:Bool -> Pair(Reader<S, M>, Stream<V>)

template skip_owned source · line 97 · raw

@-S:Data -> @-M:Data -> @-V:Data -> @reader:Reader<S, M> -> @stream:Stream<V> -> @tick:Nat -> Pair(Reader<S, M>, Stream<V>)