| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
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
- 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.