def run

bendvy-ecs-core@0.1.0.4 · ordinary_recovery_system.bend:72

import bendvy-ecs-core@0.1.0.4/ordinary_recovery_system.bend as OrdinaryRecoverySystem
import 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/transaction.bend as T
import bendvy-ecs-core@0.1.0.4/owner_product.bend as Product
import bendvy-ecs-core@0.1.0.4/ordinary_recovery_declaration.bend as D

72# Validate registration and execute with retained capture and affine Args.
73# Admission refusal returns original owners/Args. Completed returns semantic
74# outcome, Out and typed recovery on both body success and failure; inspect
75# outcome instead of assuming outer transport means commit. Every admitted completion consumes its captured lifecycle tick,
76# including semantic failure; recovery ownership remains in Reply.
77def run(~S:Data,~C:Type,~R:Type,~E:Data,~Capture:Type,~Recovery:Type,~Ops:Type -> Type,~Args:Type,~Error:Data,~Out:Type,~builder:D.Builder(~Product.Owner<W.World<S,C,R,E>,Capture>,~Recovery,~Ops),~declaration:D.Declaration<S,Product.Owner<W.World<S,C,R,E>,Capture>,Recovery,Ops,builder>,~body:@-H:Type -> @-caps:Ops(H) -> Args -> H -> H & (T.Outcome<Error> & Out),owner:Owner<Sys.Registry<S,C,R,E,Request<Args,Capture>,Unit,Reply<Capture,Recovery,Error,Out>,runner(~S,~C,~R,~E,~Capture,~Recovery,~Ops,~Args,~Error,~Out,~builder,~declaration,~body)>,Capture>,world:W.World<S,C,R,E>,args:Args) -> Run<W.World<S,C,R,E>,Owner<Sys.Registry<S,C,R,E,Request<Args,Capture>,Unit,Reply<Capture,Recovery,Error,Out>,runner(~S,~C,~R,~E,~Capture,~Recovery,~Ops,~Args,~Error,~Out,~builder,~declaration,~body)>,Capture>,Args,Error,Out,Recovery>:
78  match owner:
79    case Owner{registry,capture}:completed(~S,~C,~R,~E,~Capture,~Recovery,~Ops,~Args,~Error,~Out,~builder,~declaration,~body,Sys.run(~S,~C,~R,~E,~Request<Args,Capture>,~Unit,~Reply<Capture,Recovery,Error,Out>,~runner(~S,~C,~R,~E,~Capture,~Recovery,~Ops,~Args,~Error,~Out,~builder,~declaration,~body),registry,world,Request{args,capture}))

Uses (15)

Used by (1)