def attach

bendvy-ecs-core@0.1.0.4 · ordinary_app_run.bend:43

import bendvy-ecs-core@0.1.0.4/ordinary_app_run.bend as OrdinaryAppRun
import Base
import bendvy-ecs-core@0.1.0.4/ordinary_app_execution_recipe.bend as Recipe
import bendvy-ecs-core@0.1.0.4/ordinary_app_composer.bend as Build
import bendvy-ecs-core@0.1.0.4/ordinary_app_schedule.bend as Single
import bendvy-ecs-core@0.1.0.4/ordinary_app_registration_fields.bend as Records
import bendvy-ecs-core@0.1.0.4/ordinary_app_observation_data.bend as DTO
import bendvy-ecs-core@0.1.0.4/ordinary_schema.bend as Schema
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/schedule_provision.bend as SP

43# Derive and validate a schedule from the existing registered application.
44# Returns Attached with the executable App, or Invalid with the original
45# registered owner; world and registration owners are never copied.
46# Validates registration identity and schedule structure before execution.
47# barrier=True prepends an explicit barrier; False adds none. Registration
48# order is retained by the derived plan. No system body runs here.
49# Example: examples/scheduled-health/registration.bend, attach().
50def attach(~S:Data,~C:Type,~R:Type,~E:Data,~H:Type,~Rows:Data,~observe:W.World<S,C,R,E> -> W.World<S,C,R,E> & DTO.Observation<Rows>,~fold:H -> H & List<&2,Records.Fields<S>>,~Error:Data,~plan:H -> H & SP.Plan<S>,~dispatch:H -> Ctx.Context<W.World<S,C,R,E>> -> U32 -> H & Sys.Outcome<Ctx.Context<W.World<S,C,R,E>>,Error,Unit>,~provide:W.World<S,C,R,E> -> W.World<S,C,R,E> & List<&2,SP.Requirement<S>>,schema:Schema.Schema<S,C,R>,value:Recipe.Registered<S,W.World<S,C,R,E>,H,Rows,observe,fold,Error,plan,dispatch,provide>,name:String,barrier:Bool) -> Single.Attachment<Recipe.Registered<S,W.World<S,C,R,E>,H,Rows,observe,fold,Error,plan,dispatch,provide>,Application<S,C,R,E,H,Rows,observe,fold,Error,plan,dispatch,provide>>:
51  match value:
52    case Recipe.Registered{Build.Registered{world,owners,recipe,debug},_}:planned(~S,~C,~R,~E,~H,~Rows,~observe,~fold,~Error,~plan,~dispatch,~provide,schema,world,recipe,debug,name,barrier,plan(owners))

Uses (19)

Used by (1)