Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data WantedDirection
- data Stability
- type OpGraph = GraphData PreOp OpUniqueId
- data OpStatus
- opCheckResult :: Lens' OpStatus CheckResult
- type OpStatusesMap = Map OpUniqueId (TVar OpStatus)
- data OpIntent
- intentPreOp :: Lens' OpIntent PreOp
- intentDirection :: Lens' OpIntent WantedDirection
- type Intents = Map OpUniqueId OpHistory
- emptyIntents :: Intents
- type Broadcast = (OpUniqueId, CheckResult, Stability, WantedDirection) -> IO ()
- noBroadcast :: Broadcast
- snapshot :: WantedDirection -> OpGraph -> Intents -> Intents
- makeStatusesMap :: Intents -> STM OpStatusesMap
- asyncTurnupGraph :: Broadcast -> OpStatusesMap -> Intents -> OpGraph -> IO ()
- asyncTurndownGraph :: Broadcast -> OpStatusesMap -> Intents -> OpGraph -> IO ()
- checkWholeGraph :: Broadcast -> OpStatusesMap -> Intents -> OpGraph -> IO [Async (OpUniqueId, CheckResult, Stability, WantedDirection)]
- upkeepGraph :: Broadcast -> OpStatusesMap -> Intents -> OpGraph -> UpkeepFSM -> DownkeepFSM -> IO ()
- defaultUpKeepFSM :: UpkeepFSM
- defaultDownKeepFSM :: DownkeepFSM
- waitStability :: WantedDirection -> Stability -> [TVar OpStatus] -> STM ()
- syncTurnupGraph :: Broadcast -> OpGraph -> IO ()
- syncTurnDownGraph :: Broadcast -> OpGraph -> IO ()
Documentation
data WantedDirection Source #
The intended direction of an operation.
Instances
The stability an operation reached.
The observed status for an operation.
type OpStatusesMap = Map OpUniqueId (TVar OpStatus) Source #
A map representing the mutable status for a set of operations.
type Intents = Map OpUniqueId OpHistory Source #
A map representing the collection of histories for a set of operations.
type Broadcast = (OpUniqueId, CheckResult, Stability, WantedDirection) -> IO () Source #
Asynchronous Operations
snapshot :: WantedDirection -> OpGraph -> Intents -> Intents Source #
Computes a snapshot of an OpGraph.
makeStatusesMap :: Intents -> STM OpStatusesMap Source #
Returns an operation to atomically build a status map from a graph snapshot.
asyncTurnupGraph :: Broadcast -> OpStatusesMap -> Intents -> OpGraph -> IO () Source #
asyncTurndownGraph :: Broadcast -> OpStatusesMap -> Intents -> OpGraph -> IO () Source #
TODO: no longer transpose graph at the calling sites
checkWholeGraph :: Broadcast -> OpStatusesMap -> Intents -> OpGraph -> IO [Async (OpUniqueId, CheckResult, Stability, WantedDirection)] Source #
:: Broadcast | function delivering node change updates |
-> OpStatusesMap | instantaneous statuses |
-> Intents | historical intents |
-> OpGraph | graph containing adjacencies |
-> UpkeepFSM | FSM to apply to nodes that must be up |
-> DownkeepFSM | FSM to apply to nodes that must be down |
-> IO () |
Turns a graph up and keep it up.
defaultUpKeepFSM :: UpkeepFSM Source #
defaultDownKeepFSM :: DownkeepFSM Source #
waitStability :: WantedDirection -> Stability -> [TVar OpStatus] -> STM () Source #
Atomically wait until all statuses are stable after reaching a given direction.