| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Network.TxSubmission.Mempool.Simple
Description
The module should be imported qualified.
Synopsis
- newtype Mempool (m :: Type -> Type) tx = Mempool (StrictTVar m (Seq tx))
- empty :: MonadSTM m => m (Mempool m tx)
- new :: MonadSTM m => [tx] -> m (Mempool m tx)
- read :: MonadSTM m => Mempool m tx -> m [tx]
- getReader :: forall tx txid (m :: Type -> Type). (MonadSTM m, Eq txid) => (tx -> txid) -> (tx -> SizeInBytes) -> Mempool m 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 tx -> TxSubmissionMempoolWriter txid tx Int m
Documentation
getReader :: forall tx txid (m :: Type -> Type). (MonadSTM m, Eq txid) => (tx -> txid) -> (tx -> SizeInBytes) -> Mempool m 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 tx | |
| -> TxSubmissionMempoolWriter txid tx Int m |
A simple mempool writer.