| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
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
- data ServiceRuntime = ServiceRuntime {
- svcRole :: MirrorRole
- svcRunsWorker :: Bool
- svcEnv :: Env
- svcAppConfig :: AppConfig
- svcBindings :: [MountBinding]
- svcWorkerPolicies :: WorkerPolicies
- svcMirrorDrain :: Maybe (IO ())
- svcSyncTasks :: [IO ()]
- svcMemorySampler :: IO ()
- svcCheckReady :: IO Readiness
- svcCheckLive :: IO Liveness
- withServiceRuntime :: BootEnv -> ExecutablePlan -> MirrorWiring -> (ServiceRuntime -> IO ()) -> IO ()
- workerLiveness :: Bool -> WorkerHeartbeat -> IO Liveness
- runWorker :: WorkerPolicies -> Env -> IO ()
- mountBindingFor :: Ecosystem -> PackumentDeps -> Maybe PublishDeps -> Maybe MountBinding
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.