event_publication.bend checks
raw source on the hub · import bendvy-ecs-core@0.1.0.6/event_publication.bend as Event_publication
6 imports
import Base import world.bend as W import event_runtime.bend as Ev import transaction.bend as Tx import ordinary_event_declaration.bend as Event import event_stream.bend as Leaf
Types
type Publication source · line 10 · raw
@A:Data -> @B:Data -> Data
Each ordinary emit stages one singleton product record. Tx.finish preserves the record list's emission order; products are never merged across emissions.
Publication@A:Data -> @B:Data -> @first:List<&2, A> -> @second:List<&2, B> -> Publication<A, B>
type Streams source · line 12 · raw
@S:Data -> @A:Data -> @B:Data -> @H:Type -> Type
Streams@S:Data -> @A:Data -> @B:Data -> @H:Type -> @first:0x14a72e1c180a5ab1f8a056d43822425c/event_stream.Stream<S, A> -> @second:0x14a72e1c180a5ab1f8a056d43822425c/event_stream.Stream<S, B> -> @owners:H -> Streams<S, A, B, H>
type Application source · line 14 · raw
@S:Data -> @C:Type -> @R:Type -> @A:Data -> @B:Data -> @H:Type -> Type
Application@S:Data -> @C:Type -> @R:Type -> @A:Data -> @B:Data -> @H:Type -> @world:0x14a72e1c180a5ab1f8a056d43822425c/world.World<S, C, R, Publication<A, B>> -> @streams:Streams<S, A, B, H> -> @journal:List<&2, 0x14a72e1c180a5ab1f8a056d43822425c/event_runtime.Batch<Publication<A, B>>> -> @tick:Nat -> @frameStart:Nat -> Application<S, C, R, A, B, H>
Templates
template setup source · line 16 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-A:Data -> @-B:Data -> @-H:Type -> @world:0x14a72e1c180a5ab1f8a056d43822425c/world.World<S, C, R, Publication<A, B>> -> @first:0x14a72e1c180a5ab1f8a056d43822425c/ordinary_event_declaration.Domain<S, A> -> @second:0x14a72e1c180a5ab1f8a056d43822425c/ordinary_event_declaration.Domain<S, B> -> @owners:H -> @+capacity:Nat -> Application<S, C, R, A, B, H>
template first_take source · line 18 · raw
@-S:Data -> @-A:Data -> @-B:Data -> @-H:Type -> @streams:Streams<S, A, B, H> -> Pair(Streams<S, A, B, H>, 0x14a72e1c180a5ab1f8a056d43822425c/event_stream.Stream<S, A>)
template first_put source · line 21 · raw
@-S:Data -> @-A:Data -> @-B:Data -> @-H:Type -> @streams:Streams<S, A, B, H> -> @first:0x14a72e1c180a5ab1f8a056d43822425c/event_stream.Stream<S, A> -> Streams<S, A, B, H>
template second_take source · line 24 · raw
@-S:Data -> @-A:Data -> @-B:Data -> @-H:Type -> @streams:Streams<S, A, B, H> -> Pair(Streams<S, A, B, H>, 0x14a72e1c180a5ab1f8a056d43822425c/event_stream.Stream<S, B>)
template second_put source · line 27 · raw
@-S:Data -> @-A:Data -> @-B:Data -> @-H:Type -> @streams:Streams<S, A, B, H> -> @second:0x14a72e1c180a5ab1f8a056d43822425c/event_stream.Stream<S, B> -> Streams<S, A, B, H>
template emit_first source · line 30 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-A:Data -> @-B:Data -> @tx:0x14a72e1c180a5ab1f8a056d43822425c/transaction.Tx<0x14a72e1c180a5ab1f8a056d43822425c/world.World<S, C, R, Publication<A, B>>, Publication<A, B>> -> @event:A -> 0x14a72e1c180a5ab1f8a056d43822425c/transaction.Tx<0x14a72e1c180a5ab1f8a056d43822425c/world.World<S, C, R, Publication<A, B>>, Publication<A, B>>
template emit_second source · line 32 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-A:Data -> @-B:Data -> @tx:0x14a72e1c180a5ab1f8a056d43822425c/transaction.Tx<0x14a72e1c180a5ab1f8a056d43822425c/world.World<S, C, R, Publication<A, B>>, Publication<A, B>> -> @event:B -> 0x14a72e1c180a5ab1f8a056d43822425c/transaction.Tx<0x14a72e1c180a5ab1f8a056d43822425c/world.World<S, C, R, Publication<A, B>>, Publication<A, B>>
template prepend_values source · line 36 · raw
@-E:Data -> @values:List<&2, E> -> @reversed:List<&2, E> -> List<&2, E>
Reverse-accumulate each record's values, then reverse once. Both traversals decrease before the accumulator and preserve order within/across records.
template first_values_loop source · line 40 · raw
@-A:Data -> @-B:Data -> @items:List<&2, Publication<A, B>> -> @reversed:List<&2, A> -> List<&2, A>
template first_values source · line 44 · raw
@-A:Data -> @-B:Data -> @items:List<&2, Publication<A, B>> -> List<&2, A>
template second_values_loop source · line 45 · raw
@-A:Data -> @-B:Data -> @items:List<&2, Publication<A, B>> -> @reversed:List<&2, B> -> List<&2, B>
template second_values source · line 49 · raw
@-A:Data -> @-B:Data -> @items:List<&2, Publication<A, B>> -> List<&2, B>
template synced source · line 50 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-A:Data -> @-B:Data -> @-H:Type -> @observed:Pair(0x14a72e1c180a5ab1f8a056d43822425c/world.World<S, C, R, Publication<A, B>>, List<&2, Publication<A, B>>) -> @streams:Streams<S, A, B, H> -> @+journal:List<&2, 0x14a72e1c180a5ab1f8a056d43822425c/event_runtime.Batch<Publication<A, B>>> -> @+tick:Nat -> @frameStart:Nat -> Application<S, C, R, A, B, H>
template sync source · line 55 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-A:Data -> @-B:Data -> @-H:Type -> @app:Application<S, C, R, A, B, H> -> Application<S, C, R, A, B, H>
template observed_read source · line 61 · raw
@-S:Data -> @-E:Data -> @-F:Type -> @-put:(@_:F -> @_:0x14a72e1c180a5ab1f8a056d43822425c/event_stream.Stream<S, E> -> F) -> @family:F -> @returned:Pair(0x14a72e1c180a5ab1f8a056d43822425c/event_stream.Stream<S, E>, 0x14a72e1c180a5ab1f8a056d43822425c/event_runtime.Reading<E>) -> Pair(F, 0x14a72e1c180a5ab1f8a056d43822425c/event_runtime.Reading<E>)
Arbitrary finite products can use this same closed selection operation. The generated take/put retain every other leaf and arbitrary affine owner H.
template observed_leaf source · line 64 · raw
@-S:Data -> @-E:Data -> @-F:Type -> @-put:(@_:F -> @_:0x14a72e1c180a5ab1f8a056d43822425c/event_stream.Stream<S, E> -> F) -> @returned:Pair(F, 0x14a72e1c180a5ab1f8a056d43822425c/event_stream.Stream<S, E>) -> @+tick:Nat -> @id:U32 -> Pair(F, 0x14a72e1c180a5ab1f8a056d43822425c/event_runtime.Reading<E>)
template observe source · line 67 · raw
@-S:Data -> @-E:Data -> @-F:Type -> @-take:(@_:F -> Pair(F, 0x14a72e1c180a5ab1f8a056d43822425c/event_stream.Stream<S, E>)) -> @-put:(@_:F -> @_:0x14a72e1c180a5ab1f8a056d43822425c/event_stream.Stream<S, E> -> F) -> @family:F -> @id:U32 -> @tick:Nat -> Pair(F, 0x14a72e1c180a5ab1f8a056d43822425c/event_runtime.Reading<E>)
template retained_values source · line 70 · raw
@-E:Data -> @remove:Bool -> @values:List<&2, E> -> List<&2, E>
template retained_record source · line 74 · raw
@-A:Data -> @-B:Data -> @record:Publication<A, B> -> @+tick:Nat -> @+firstDropped:Nat -> @+secondDropped:Nat -> Publication<A, B>
template nonempty_record source · line 77 · raw
@-A:Data -> @-B:Data -> @record:Publication<A, B> -> Bool
template retained_head source · line 80 · raw
@-A:Data -> @-B:Data -> @keep:Bool -> @record:Publication<A, B> -> @rest:List<&2, Publication<A, B>> -> List<&2, Publication<A, B>>
template retained_join source · line 84 · raw
@-A:Data -> @-B:Data -> @+record:Publication<A, B> -> @rest:List<&2, Publication<A, B>> -> List<&2, Publication<A, B>>
template retained_records source · line 86 · raw
@-A:Data -> @-B:Data -> @records:List<&2, Publication<A, B>> -> @+tick:Nat -> @+firstDropped:Nat -> @+secondDropped:Nat -> List<&2, Publication<A, B>>
template retained_batch source · line 90 · raw
@-A:Data -> @-B:Data -> @keep:Bool -> @tick:Nat -> @records:List<&2, Publication<A, B>> -> @rest:List<&2, 0x14a72e1c180a5ab1f8a056d43822425c/event_runtime.Batch<Publication<A, B>>> -> List<&2, 0x14a72e1c180a5ab1f8a056d43822425c/event_runtime.Batch<Publication<A, B>>>
template retained_batch_join source · line 94 · raw
@-A:Data -> @-B:Data -> @tick:Nat -> @+records:List<&2, Publication<A, B>> -> @rest:List<&2, 0x14a72e1c180a5ab1f8a056d43822425c/event_runtime.Batch<Publication<A, B>>> -> List<&2, 0x14a72e1c180a5ab1f8a056d43822425c/event_runtime.Batch<Publication<A, B>>>
template retained_journal source · line 96 · raw
@-A:Data -> @-B:Data -> @journal:List<&2, 0x14a72e1c180a5ab1f8a056d43822425c/event_runtime.Batch<Publication<A, B>>> -> @+firstDropped:Nat -> @+secondDropped:Nat -> List<&2, 0x14a72e1c180a5ab1f8a056d43822425c/event_runtime.Batch<Publication<A, B>>>
template framed_journal source · line 100 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-A:Data -> @-B:Data -> @-H:Type -> @world:0x14a72e1c180a5ab1f8a056d43822425c/world.World<S, C, R, Publication<A, B>> -> @streams:Streams<S, A, B, H> -> @+tick:Nat -> @+journal:List<&2, 0x14a72e1c180a5ab1f8a056d43822425c/event_runtime.Batch<Publication<A, B>>> -> Application<S, C, R, A, B, H>
template framed_streams source · line 102 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-A:Data -> @-B:Data -> @-H:Type -> @world:0x14a72e1c180a5ab1f8a056d43822425c/world.World<S, C, R, Publication<A, B>> -> @streams:Streams<S, A, B, H> -> @tick:Nat -> @journal:List<&2, 0x14a72e1c180a5ab1f8a056d43822425c/event_runtime.Batch<Publication<A, B>>> -> Application<S, C, R, A, B, H>
template frame source · line 106 · raw
@-S:Data -> @-C:Type -> @-R:Type -> @-A:Data -> @-B:Data -> @-H:Type -> @app:Application<S, C, R, A, B, H> -> Application<S, C, R, A, B, H>