| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Arbiter.Worker.Reaper
Description
Internal to the arbiter packages. Not covered by the PVP.
runMaintenancePass and MaintenancePace are public through Arbiter.Worker.
Schema-wide maintenance coordinated across worker pools.
Synopsis
- reaperLoop :: (RegistryAdmissionPolicies (RegistryOf m), MonadArbiter m, RegistryTables (RegistryOf m)) => LogConfig -> (MaintenanceOp -> Int64 -> m ()) -> MaintenancePace -> NominalDiffTime -> m ()
- runMaintenancePass :: (RegistryAdmissionPolicies (RegistryOf m), MonadArbiter m, RegistryTables (RegistryOf m)) => LogConfig -> (MaintenanceOp -> Int64 -> m ()) -> MaintenancePace -> NominalDiffTime -> m [MaintenanceOp]
- data MaintenancePace = MaintenancePace {}
- runReaperOp :: MonadArbiter m => LogConfig -> NominalDiffTime -> Text -> NominalDiffTime -> m a -> m (Maybe a)
Documentation
reaperLoop :: (RegistryAdmissionPolicies (RegistryOf m), MonadArbiter m, RegistryTables (RegistryOf m)) => LogConfig -> (MaintenanceOp -> Int64 -> m ()) -> MaintenancePace -> NominalDiffTime -> m ()Source #
Run schema-wide maintenance, with each operation independently gated across all worker pools.
runMaintenancePass :: (RegistryAdmissionPolicies (RegistryOf m), MonadArbiter m, RegistryTables (RegistryOf m)) => LogConfig -> (MaintenanceOp -> Int64 -> m ()) -> MaintenancePace -> NominalDiffTime -> m [MaintenanceOp]Source #
Arguments
| :: (RegistryAdmissionPolicies (RegistryOf m), MonadArbiter m, RegistryTables (RegistryOf m)) | |
| => LogConfig | |
| -> (MaintenanceOp -> Int64 -> m ()) | |
| -> MaintenancePace | |
| -> NominalDiffTime | Statement timeout |
| -> m [MaintenanceOp] |
One pass of the maintenance the reaper runs, with each operation independently
gated across all callers. An operation whose window has not elapsed is skipped.
The pass covers every queue in the schema (schemaQueues), not only the
caller's registry. Which caller wins a gate does not change the result.
Returns the operations that threw. A failure for one queue is logged and not
returned. A failure does not stop the pass. When the schema's queues cannot be
read, no operation runs and every operation is returned.
data MaintenancePaceSource #
Gaps between runs of each kind of work, and the bucket idle age. A zero gap runs that work every pass.
Constructors
| MaintenancePace | |
Fields
| |
Instances
| Eq MaintenancePace Source # | |
Defined in Arbiter.Worker.Reaper Methods (==) :: MaintenancePace -> MaintenancePace -> Bool# (/=) :: MaintenancePace -> MaintenancePace -> Bool# | |
| Show MaintenancePace Source # | |
Defined in Arbiter.Worker.Reaper Methods showsPrec :: Int -> MaintenancePace -> ShowS# show :: MaintenancePace -> String# showList :: [MaintenancePace] -> ShowS# | |
runReaperOp :: MonadArbiter m => LogConfig -> NominalDiffTime -> Text -> NominalDiffTime -> m a -> m (Maybe a)Source #
Arguments
| :: MonadArbiter m | |
| => LogConfig | |
| -> NominalDiffTime | Statement timeout |
| -> Text | Task name |
| -> NominalDiffTime | Gate window: minimum gap between runs across all callers |
| -> m a | |
| -> m (Maybe a) |
Run one gated maintenance operation. Nothing when it failed, is running
elsewhere, or its window has not elapsed. Failures are logged.