ouroboros-consensus
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Storage.LeiosDB.API

Synopsis

Handle

data LeiosDbHandle (m ∷ Type → Type) Source #

The Leios database. Hands out readers, writers and subscriptions.

Constructors

LeiosDbHandle 

Fields

data LeiosDbStats Source #

In-memory LeiosDb counters: seeded from the database files once per handle, bumped by the write, copy and GC paths, never written back.

An EB that has been copied to the immutable partition but not yet evicted from the volatile one counts in both partitions -- that is the truth on disk during the window between copy and GC.

Constructors

LeiosDbStats 

Fields

Instances

Instances details
Show LeiosDbStats Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.LeiosDB.Trace

data LeiosEbNotification Source #

Constructors

AcquiredEb

An EB body was written.

Fields

AcquiredEbTxs

Every tx of the EB is now in the DB.

Fields

Reading

data LeiosDbReader (m ∷ Type → Type) Source #

Query API into the LeiosDb. Do not use a reader in two concurrent threads.

Constructors

LeiosDbReader 

Fields

withReader ∷ MonadThrow m ⇒ LeiosDbHandle m → (LeiosDbReader m → m a) → m a Source #

Writing

data LeiosDbWriter (m ∷ Type → Type) Source #

Modifying API into the LeiosDb.

Asynchronous interface where each operation returns upon submission. The returned Promise can be used to await the write being performed. Any exceptions are thrown through await.

Constructors

LeiosDbWriter 

Fields

newtype Promise (m ∷ Type → Type) a Source #

The result of a submitted write.

await rethrows whatever the write threw, in the awaiting thread, as a LeiosDbException naming the write and the site that submitted it. Awaiting twice is fine. Not awaiting discards the failure along with the result: collect promises and awaitAll them instead, unless the write's fate genuinely does not matter.

Constructors

Promise 

Fields

Instances

Instances details
Functor m ⇒ Functor (Promise m) Source # 
Instance details

Defined in Ouroboros.Consensus.Storage.LeiosDB.API

Methods

fmap ∷ (a → b) → Promise m a → Promise m b #

(<$) ∷ a → Promise m b → Promise m a #

awaitAll ∷ (Foldable t, Applicative m) ⇒ t (Promise m ()) → m () Source #

Await every promise, in order.

withWriter ∷ MonadThrow m ⇒ LeiosDbHandle m → (LeiosDbWriter m → m a) → m a Source #

type CompletedEbs = [LeiosPoint] Source #

EBs whose tx closure became complete as a result of a write.