deptrack-devops-0.1.0.0: DepTrack applied to DevOps.

Safe HaskellNone
LanguageHaskell2010

Devops.Graph

Contents

Synopsis

Documentation

data WantedDirection Source #

The intended direction of an operation.

Constructors

TurnedUp 
TurnedDown 
Instances
Eq WantedDirection Source # 
Instance details

Defined in Devops.Graph

Ord WantedDirection Source # 
Instance details

Defined in Devops.Graph

Show WantedDirection Source # 
Instance details

Defined in Devops.Graph

Generic WantedDirection Source # 
Instance details

Defined in Devops.Graph

Associated Types

type Rep WantedDirection :: * -> * #

type Rep WantedDirection Source # 
Instance details

Defined in Devops.Graph

type Rep WantedDirection = D1 (MetaData "WantedDirection" "Devops.Graph" "deptrack-devops-0.1.0.0-1BQsWDMcJxoKhJobugMn50" False) (C1 (MetaCons "TurnedUp" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "TurnedDown" PrefixI False) (U1 :: * -> *))

data Stability Source #

The stability an operation reached.

Constructors

Stable 
Transient 
Instances
Eq Stability Source # 
Instance details

Defined in Devops.Graph

Ord Stability Source # 
Instance details

Defined in Devops.Graph

Show Stability Source # 
Instance details

Defined in Devops.Graph

Generic Stability Source # 
Instance details

Defined in Devops.Graph

Associated Types

type Rep Stability :: * -> * #

type Rep Stability Source # 
Instance details

Defined in Devops.Graph

type Rep Stability = D1 (MetaData "Stability" "Devops.Graph" "deptrack-devops-0.1.0.0-1BQsWDMcJxoKhJobugMn50" False) (C1 (MetaCons "Stable" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "Transient" PrefixI False) (U1 :: * -> *))

type OpGraph = GraphData PreOp OpUniqueId Source #

An OpGraph is a Graph containing PreOp.

data OpStatus Source #

The observed status for an operation.

Instances
Show OpStatus Source # 
Instance details

Defined in Devops.Graph

type OpStatusesMap = Map OpUniqueId (TVar OpStatus) Source #

A map representing the mutable status for a set of operations.

data OpIntent Source #

A snapshot representing the intent for a single operation at a given time.

type Intents = Map OpUniqueId OpHistory Source #

A map representing the collection of histories for a set of operations.

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.

asyncTurndownGraph :: Broadcast -> OpStatusesMap -> Intents -> OpGraph -> IO () Source #

TODO: no longer transpose graph at the calling sites

upkeepGraph Source #

Arguments

:: 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.

defaultDownKeepFSM :: DownkeepFSM Source #

waitStability :: WantedDirection -> Stability -> [TVar OpStatus] -> STM () Source #

Atomically wait until all statuses are stable after reaching a given direction.

Synchronous Operations

syncTurnupGraph :: Broadcast -> OpGraph -> IO () Source #

Turn-up a graph sequentially

Topologically sorts the graph then invokes TurnUp action synchronously through each node. Note the order of execution is deterministic.

syncTurnDownGraph :: Broadcast -> OpGraph -> IO () Source #

Turn-down a graph sequentially

Topologically sorts the graph then invokes TurnDown action synchronously through each node. Note the order of execution is deterministic.