def execution_run

bendvy-ecs-core@0.1.0.4 · ordinary_app_service_registration.bend:86

import bendvy-ecs-core@0.1.0.4/ordinary_app_service_registration.bend as OrdinaryAppServiceRegistration
import Base
import bendvy-ecs-core@0.1.0.4/execution_context.bend as Ctx
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/ordinary_service_declaration.bend as D

86# Advanced dispatch entry: an unmatched id returns Owner/context with Failed(Unit)
87# without calling P. Matched routing invokes tracked run; schedule provisioning
88# performs availability checks separately.
89def execution_run(~S:Data,~C:Type,~R:Type,~E:Data,~Payload:Type,~Rest:Type,~take:R -> Rest & D.Slot<Payload>,~put:Rest -> D.Slot<Payload> -> R,~call:Payload -> Payload,~declaration:D.Declaration<S,R,Payload,Rest,take,put,call>,~scan:W.World<S,C,R,E> -> W.World<S,C,R,E> & List<&2,D.Status<S>>,owner:Owner<S,C,R,E,Payload,Rest,take,put,call,declaration,scan>,context:Ctx.Context<W.World<S,C,R,E>>,id:U32) -> Owner<S,C,R,E,Payload,Rest,take,put,call,declaration,scan> & Sys.Outcome<Ctx.Context<W.World<S,C,R,E>>,Unit,Unit>:
90  match owner:
91    case Owner{Sys.Registry{namespace,+actual,name,access,cursor},setup}:
92      +selected=id
93      execution_allowed(~S,~C,~R,~E,~Payload,~Rest,~take,~put,~call,~declaration,~scan,U32.is_eq(selected,actual),Owner{Sys.Registry{namespace,actual,name,access,cursor},setup},context,selected)

Uses (14)

Used by (2)