| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Network.TxSubmission.Mempool.Simple
Description
The module should be imported qualified.
Synopsis
- newtype Mempool (m :: Type -> Type) txid tx = Mempool (StrictTVar m (MempoolSeq txid tx))
- data MempoolSeq txid tx = MempoolSeq {
- mempoolSet :: !(Set txid)
- mempoolSeq :: !(Seq tx)
- empty :: MonadSTM m => m (Mempool m txid tx)
- new :: (MonadSTM m, Ord txid) => (tx -> txid) -> [tx] -> m (Mempool m txid tx)
- read :: MonadSTM m => Mempool m txid tx -> m [tx]
- getReader :: forall tx txid (m :: Type -> Type). (MonadSTM m, Eq txid) => (tx -> txid) -> (tx -> SizeInBytes) -> Mempool m txid tx -> TxSubmissionMempoolReader txid tx Int m
- getWriter :: forall tx txid ctx failure m. (MonadSTM m, MonadThrow m, Ord txid, Typeable txid, Typeable failure, Show txid, Show failure) => (tx -> txid) -> m ctx -> (ctx -> tx -> Either failure ()) -> (failure -> Bool) -> Mempool m txid tx -> TxSubmissionMempoolWriter txid tx Int m
Documentation
newtype Mempool (m :: Type -> Type) txid tx Source #
A simple in-memory mempool implementation.
Constructors
| Mempool (StrictTVar m (MempoolSeq txid tx)) |
data MempoolSeq txid tx Source #
Constructors
| MempoolSeq | |
Fields
| |
getReader :: forall tx txid (m :: Type -> Type). (MonadSTM m, Eq txid) => (tx -> txid) -> (tx -> SizeInBytes) -> Mempool m txid tx -> TxSubmissionMempoolReader txid tx Int m 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 |
| -> (failure -> Bool) | return |
| -> Mempool m txid tx | |
| -> TxSubmissionMempoolWriter txid tx Int m |
A simple mempool writer.