OrdinaryAppCaptureQuery.add: def of bendvy-ecs-core@0.1.0.4 Import: import bendvy-ecs-core@0.1.0.4/ordinary_app_capture_query.bend as OrdinaryAppCaptureQuery Lines 65-78 of bendvy-ecs-core@0.1.0.4/ordinary_app_capture_query.bend: https://jend.leeeet.dev/read.txt?path=bendvy-ecs-core@0.1.0.4/ordinary_app_capture_query.bend&start_line=65&end_line=78 import Base import bendvy-ecs-core@0.1.0.4/ordinary_app_execution_recipe.bend as Exec import bendvy-ecs-core@0.1.0.4/execution_context.bend as Ctx import bendvy-ecs-core@0.1.0.4/schedule_provision.bend as SP import bendvy-ecs-core@0.1.0.4/ordinary_app_registration_fields.bend as Records 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/compose.bend as Q import bendvy-ecs-core@0.1.0.4/ordinary_query_declaration.bend as Decl import bendvy-ecs-core@0.1.0.4/ordinary_app_capture_query_fields.bend as Fields import bendvy-ecs-core@0.1.0.4/ordinary_app_observation_data.bend as DTO # Register a captured query during App setup, consuming value and capture. # On success done receives the extended App. On refusal failed receives the # returned prior App AND capture, so the caller can recover or explicitly drop # those affine owners. args is retained for future invocations; name follows # the ordinary registry rules. No callback runs during this registration. # During execution, failure rolls back transactional writes and clears row # outputs, but retains the callback-returned capture: capture mutation is not # ECS rollback. Failure/refusal do not advance the query reader cursor; success does. # Deferred structural commands still need the ordinary explicit barrier. # Runnable example: bash examples/captured-query/run.sh js (or native). # Its app.bend:add_second shows add; body.bend returns all owners on failure. def add(~S:Data,~C:Type,~R:Type,~E:Data,~Owners:Type,~Rows:Data,~observe:W.World -> W.World & DTO.Observation,~fold:Owners -> Owners & List<&2,Records.Fields>,~PriorError:Data,~priorPlan:Owners -> Owners & SP.Plan,~priorDispatch:Owners -> Ctx.Context> -> U32 -> Owners & Sys.Outcome>,PriorError,Unit>,~priorProvide:W.World -> W.World & List<&2,SP.Requirement>,~L:Type,~Ops:Type -> Type,~Args:Data,~Error:Data,~Out:Data,~query:Decl.Declaration,Ops(Q.Frame)>,~body:@-H:Type -> @-caps:Ops(H) -> L -> Args -> H -> H & (L & (T.Outcome & Out)),~Output:Type,done:Application(~S,~C,~R,~E,~Owners,~Rows,~observe,~fold,~PriorError,~priorPlan,~priorDispatch,~priorProvide,~L,~Ops,~Args,~Error,~Out,~query,~body) -> Output,failed:Exec.Registered,Owners,Rows,observe,fold,PriorError,priorPlan,priorDispatch,priorProvide> -> L -> Output,value:Exec.Registered,Owners,Rows,observe,fold,PriorError,priorPlan,priorDispatch,priorProvide>,args:Args,name:String,capture:L) -> Output: match value: case Exec.Registered{app,_}:added(~S,~C,~R,~E,~Owners,~Rows,~observe,~fold,~PriorError,~priorPlan,~priorDispatch,~priorProvide,~L,~Ops,~Args,~Error,~Out,~query,~body,~Output,args,done,failed,Fields.register(~S,~C,~R,~E,~L,~Ops,~Args,~Error,~Out,~query,~body,~Owners,~Rows,~observe,~fold,app,name,capture)) Uses (19): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Unit https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.4/compose.bend&name=Frame https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.4/execution_context.bend&name=Context https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.4/ordinary_app_capture_query.bend&name=Application https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.4/ordinary_app_capture_query.bend&name=added https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.4/ordinary_app_capture_query_fields.bend&name=register https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.4/ordinary_app_execution_recipe.bend&name=Registered https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.4/ordinary_app_observation_data.bend&name=Observation https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.4/ordinary_app_registration_fields.bend&name=Fields https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.4/ordinary_query_declaration.bend&name=Declaration https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.4/schedule_provision.bend&name=Plan https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.4/schedule_provision.bend&name=Requirement https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.4/system.bend&name=Outcome https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.4/transaction.bend&name=Outcome https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.4/world.bend&name=World