ouroboros-network
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Network.TxSubmission.Mempool.Simple

Description

The module should be imported qualified.

Synopsis

Documentation

newtype Mempool (m :: Type -> Type) tx Source #

A simple in-memory mempool implementation.

Constructors

Mempool (StrictTVar m (Seq tx)) 

empty :: MonadSTM m => m (Mempool m tx) Source #

new :: MonadSTM m => [tx] -> m (Mempool m tx) Source #

read :: MonadSTM m => Mempool m tx -> m [tx] Source #

getReader :: forall tx txid (m :: Type -> Type). (MonadSTM m, Eq txid) => (tx -> txid) -> (tx -> SizeInBytes) -> Mempool m tx -> TxSubmissionMempoolReader txid tx Int m Source #

getWriter Source #

Arguments

:: forall tx txid ctx failure m. (MonadSTM m, MonadThrow m, Ord txid, Typeable txid, Typeable failure, Show txid, Show failure) 
=> (tx -> txid)

get txid of a tx

-> m ctx

monadic validation ctx

-> (ctx -> tx -> Either failure ())

validate a tx, any failing tx throws an exception.

-> (failure -> Bool)

return True when a failure should throw an exception

-> Mempool m tx 
-> TxSubmissionMempoolWriter txid tx Int m 

A simple mempool writer.