| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Consensus.HardFork.History.Caching
Synopsis
- data RunWithCachedSummary (xs :: [Type]) m = RunWithCachedSummary {
- cachedRunQuery :: forall a. Qry a -> STM m (Either PastHorizonException a)
- runWithCachedSummary :: forall m xs. MonadSTM m => STM m (Summary xs) -> m (RunWithCachedSummary xs m)
- cachedRunQueryThrow :: (MonadSTM m, MonadThrow (STM m)) => RunWithCachedSummary xs m -> Qry a -> STM m a
Documentation
data RunWithCachedSummary (xs :: [Type]) m Source #
Stateful abstraction to execute queries
Constructors
| RunWithCachedSummary | |
Fields
| |
runWithCachedSummary :: forall m xs. MonadSTM m => STM m (Summary xs) -> m (RunWithCachedSummary xs m) Source #
Construct RunWithCachedSummary given action that computes the summary
Most use cases will probably construct this action from an action that reads the ledger state and then computes the summary from that.
cachedRunQueryThrow :: (MonadSTM m, MonadThrow (STM m)) => RunWithCachedSummary xs m -> Qry a -> STM m a Source #
Wrapper around cachedRunQuery which throws the PastHorizonException
This is useful for callers who know that their queries should not be past the horizon (and it would be a bug if they were).