ecluse
Safe HaskellNone
LanguageGHC2021

Ecluse.Service

Description

Shared runtime assembly for proxy and mirror-worker roles from a cleared ExecutablePlan. Ecluse.Proxy adds the front door. Ecluse.Mirror runs the same worker alone.

Synopsis

The role-shared runtime

data ServiceRuntime Source #

Everything a role needs to start its own tasks, built once by withServiceRuntime. The background tasks arrive already wrapped in their supervision policy.

Constructors

ServiceRuntime 

Fields

withServiceRuntime :: BootEnv -> ExecutablePlan -> MirrorWiring -> (ServiceRuntime -> IO ()) -> IO () Source #

Assemble the role's runtime and run action within it. The plan it takes is post-gating, so this only builds and allocates: nothing here can refuse the boot.

workerLiveness :: Bool -> WorkerHeartbeat -> IO Liveness Source #

The /livez arm a process answers from, given whether it runs the worker (spawnsWorker): the consume-loop heartbeat where it does, the listener alone where it does not.

The mirror worker

runWorker :: WorkerPolicies -> Env -> IO () Source #

Run the supervised mirror worker over the composition-root Env and the per-ecosystem bundles. The loop re-runs current policy against a job before it mirrors.

npm front door

mountBindingFor :: Ecosystem -> PackumentDeps -> Maybe PublishDeps -> Maybe MountBinding Source #

Resolve an Ecosystem to its complete MountBinding, or Nothing when that ecosystem has no registered adapter. The path prefix derives from the ecosystem (prefixFor), never config.