def from_runtime

bendvy-ecs-core@0.1.0.4 · inspector_transition_projection.bend:20

import bendvy-ecs-core@0.1.0.4/inspector_transition_projection.bend as InspectorTransitionProjection
import Base
import bendvy-ecs-core@0.1.0.4/change_tick.bend as Tick
import bendvy-ecs-core@0.1.0.4/world.bend as W
import bendvy-ecs-core@0.1.0.4/event_runtime.bend as Ev
import bendvy-ecs-core@0.1.0.4/machine_stream.bend as St
import bendvy-ecs-core@0.1.0.4/relation_commands.bend as A
import bendvy-ecs-core@0.1.0.4/inspector_stream_frame.bend as F

20# Observe the stream through the trusted resource lens and return the runtime
21# in an Inspector frame. Preserve event batches, reader positions and cursor.
22# The lens must return the resource owner with the intended stream observation.
23def from_runtime(~S:Data,~K:Data,~V:Data,~C:Type,~R:Type,~E:Data,~take:R -> R & St.Stream<V>,cursor:Maybe<&2,Tick.Tick>,runtime:Ev.Runtime<S,C,R,A.Notice<S,E>>) -> F.Frame<S,C,R,E> & TransitionLog<S,K,V>:
24  match runtime:
25    case Ev.Runtime{world,namespace,batches,positions,nextReader,tick,frameStart,boundary,capacity,dropped}:joined(~S,~K,~V,~C,~R,~E,cursor,namespace,batches,positions,nextReader,tick,frameStart,boundary,capacity,dropped,W.observe_resource(~S,~C,~R,~A.Notice<S,E>,~St.Stream<V>,~take,world))

Uses (10)

Used by (1)