ecluse
Safe HaskellNone
LanguageGHC2021

Ecluse.Service

Description

The assembly every mirror-pipeline role runs over: the composition-root Env and the services derived from it.

withServiceRuntime builds from the ExecutablePlan the boot already gated, so nothing here refuses to boot. Ecluse.Proxy adds the front door over it and Ecluse.Mirror runs the worker alone, so the dedicated worker is the same worker the serve path embeds, not a second copy.

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.