def run
import bendvy-ecs-core@0.1.0.4/ordinary_app_event_family_reader.bend as OrdinaryAppEventFamilyReaderimport Base
import bendvy-ecs-core@0.1.0.4/world.bend as W
import bendvy-ecs-core@0.1.0.4/system.bend as Sys
import bendvy-ecs-core@0.1.0.4/event_runtime.bend as Ev
import bendvy-ecs-core@0.1.0.4/event_stream.bend as Stream
import bendvy-ecs-core@0.1.0.4/event_family_routing.bend as Route
103# Run this registered reader against its typed family stream.
104# The runner receives retained unread values in publication order, a lagged flag
105# and args. On Sys.Succeeded the reader advances and synchronize threads committed
106# World/family publication into the returned runtime. On Sys.Failed its stream
107# position does not advance; the runner's returned World is retained. This wrapper
108# does not itself undo arbitrary callback or host-IO effects.
109# A routing/registration rejection returns Rejected{args} without consuming the
110# read position. The completion and actual reader/Registry owners are returned
111# on every branch. Stream retention/capacity still bound later availability;
112# lagged reports dropped unread history, so failure is not an unlimited retry
113# retention promise. Supply the matching family synchronization route; merely
114# observing fields/metadata is not a run. See event-family-routing and the
115# qualified scenarios in docs/parity/typed-data-events.md.
116def run(~S:Data,~C:Type,~R:Type,~P:Data,~E:Data,~F:Type,~A:Type,~Error:Data,~Out:Type,~take:F -> F & Stream.Stream<S,E>,~put:F -> Stream.Stream<S,E> -> F,~runner:W.World<S,C,R,P> -> Ev.Input<E,A> -> Sys.Outcome<W.World<S,C,R,P>,Error,Out>,~synchronize:W.World<S,C,R,P> -> F -> Nat -> W.World<S,C,R,P> & F,owner:Owner<S,E,Route.Reader<S,E,F,take,put>,Sys.Registry<S,C,R,P,Ev.Input<E,A>,Error,Out,runner>>,runtime:Route.Runtime<S,C,R,P,F>,args:A) -> RunResult<S,C,R,P,E,F,A,Error,Out,take,put,runner>:
117 match owner:
118 case Owner{declaration,reader,registry}:ran(~S,~C,~R,~P,~E,~F,~A,~Error,~Out,~take,~put,~runner,declaration,Route.run(~S,~C,~R,~P,~E,~F,~A,~Error,~Out,~take,~put,~runner,~synchronize,runtime,reader,registry,args))
Uses (13)
Used by (0)
No other definition uses this definition.