Safe Haskell | Safe |
---|
Ganeti lock-related types and type classes
Synopsis
- class (Ord a, Show a) => Lock a where
- lockImplications :: a -> [a]
Documentation
class (Ord a, Show a) => Lock a where Source #
The type class of being a lock
As usual, locks need to come with an order, the lock order, and be an instance of Show, so that malformed requests can meaningfully be reported.
Additionally, in Ganeti we also have group locks, like a lock for all nodes. While those group locks contain infinitely many locks, the set of locks a single lock is included in is always finite, and usually very small. So we take this association from a lock to the locks it is (strictly) included in as additional data of the type class.
It is a prerequisite that whenever a
is implied in b
, then all locks
that are in the lock order between a
and b
are also implied in b
.
lockImplications :: a -> [a] Source #
Instances
Lock GanetiLocks # | |
Defined in Ganeti.Locking.Locks lockImplications :: GanetiLocks -> [GanetiLocks] Source # | |
Lock TestLock # | |
Defined in Test.Ganeti.Locking.Allocation lockImplications :: TestLock -> [TestLock] Source # |