| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Consensus.Storage.LedgerDB.V1.BackingStore.Impl.LMDB.Status
Description
LMDB resource status with read-append-write locking
Synopsis
- data Status
- data StatusLock (m ∷ Type → Type)
- new ∷ IOLike m ⇒ Status → m (StatusLock m)
- withReadAccess ∷ IOLike m ⇒ StatusLock m → m a → m a → m a
- withWriteAccess ∷ IOLike m ⇒ StatusLock m → m a → m (a, Status) → m a
Status
Whether a resource is open or closed.
Resources that we keep track of are: (i) the full LMDB backing store, and (ii) each of the LMDB backing store value handles.
Instances
| Generic Status Source # | |||||
Defined in Ouroboros.Consensus.Storage.LedgerDB.V1.BackingStore.Impl.LMDB.Status Associated Types
| |||||
| Show Status Source # | |||||
| Eq Status Source # | |||||
| NoThunks Status Source # | |||||
| type Rep Status Source # | |||||
Defined in Ouroboros.Consensus.Storage.LedgerDB.V1.BackingStore.Impl.LMDB.Status type Rep Status = D1 ('MetaData "Status" "Ouroboros.Consensus.Storage.LedgerDB.V1.BackingStore.Impl.LMDB.Status" "ouroboros-consensus-0.28.0.0-inplace-ouroboros-consensus-lmdb" 'False) (C1 ('MetaCons "Open" 'PrefixI 'False) (U1 ∷ Type → Type) :+: C1 ('MetaCons "Closed" 'PrefixI 'False) (U1 ∷ Type → Type)) | |||||
Locks
new ∷ IOLike m ⇒ Status → m (StatusLock m) Source #
Create a new StatusLock.
Arguments
| ∷ IOLike m | |
| ⇒ StatusLock m | |
| → m a | Action to perform when closed |
| → m a | Action to perform when open |
| → m a |
A variant of withReadAccess that throws an exception if .Status ==
Closed
Note: contrary to withReadAccess, the action to perform with the
acquired lock is not of type . The Status -> aStatus is known to be
Open, or an exception would have been thrown.
Arguments
| ∷ IOLike m | |
| ⇒ StatusLock m | |
| → m a | Action to perform if closed |
| → m (a, Status) | Action to perform if open, possibly updating the |
| → m a |
A variant of withWriteAccess that throws an exception if .Status ==
Closed
Note: contrary to withWriteAccess, the action to perform with the
acquired lock is not of type . The Status -> (Status, a)Status is
known to be Open, or an exception would have been thrown.