marconi-core-1.2.0.0: Modular indexing for rewindable ledger
Safe HaskellSafe-Inferred
LanguageHaskell2010

Marconi.Core.Transformer.WithCatchup

Description

The catch-up mechanism buffered events to pass them in batch to an indexer, to reduce the time needed for an indexer to catch-up with the tip.

Once we are close enough to the tip of the chain, WithCatchup deactivate itself and pass directly the blocks to the indexer.

When you use several workers and coordinators, you may want to put the catchup on the final indexers and not on the coordinators to improve performances.

Synopsis

Documentation

data WithCatchup indexer event #

Instances

Instances details
IndexerTrans WithCatchup # 
Instance details

Defined in Marconi.Core.Transformer.WithCatchup

Methods

unwrap :: forall (indexer :: Type -> Type) event. Lens' (WithCatchup indexer event) (indexer event) #

Queryable m event query indexer => Queryable m event query (WithCatchup indexer) # 
Instance details

Defined in Marconi.Core.Transformer.WithCatchup

Methods

query :: Point event -> query -> WithCatchup indexer event -> m (Result query) #

queryLatest :: query -> WithCatchup indexer event -> m (Result query) #

(MonadIO m, IsIndex m event indexer, Ord (Point event)) => IsIndex m event (WithCatchup indexer) # 
Instance details

Defined in Marconi.Core.Transformer.WithCatchup

Methods

index :: Timed (Point event) (Maybe event) -> WithCatchup indexer event -> m (WithCatchup indexer event) #

indexAll :: (Eq (Point event), Traversable f) => f (Timed (Point event) (Maybe event)) -> WithCatchup indexer event -> m (WithCatchup indexer event) #

indexAllDescending :: (Eq (Point event), Traversable f) => f (Timed (Point event) (Maybe event)) -> WithCatchup indexer event -> m (WithCatchup indexer event) #

rollback :: Point event -> WithCatchup indexer event -> m (WithCatchup indexer event) #

setLastStablePoint :: Point event -> WithCatchup indexer event -> m (WithCatchup indexer event) #

IsSync m event indexer => IsSync m event (WithCatchup indexer) # 
Instance details

Defined in Marconi.Core.Transformer.WithCatchup

Methods

lastStablePoint :: WithCatchup indexer event -> m (Point event) #

lastSyncPoint :: WithCatchup indexer event -> m (Point event) #

(Applicative m, Resetable m event indexer) => Resetable m event (WithCatchup indexer) # 
Instance details

Defined in Marconi.Core.Transformer.WithCatchup

Methods

reset :: WithCatchup indexer event -> m (WithCatchup indexer event) #

Closeable m indexer => Closeable m (WithCatchup indexer) # 
Instance details

Defined in Marconi.Core.Transformer.WithCatchup

Methods

close :: WithCatchup indexer event -> m () #

HasDatabasePath indexer => HasDatabasePath (WithCatchup indexer) # 
Instance details

Defined in Marconi.Core.Transformer.WithCatchup

Methods

getDatabasePath :: WithCatchup indexer event -> SQLiteDBLocation #

HasCatchupConfig (WithCatchup indexer) # 
Instance details

Defined in Marconi.Core.Transformer.WithCatchup

Methods

catchupBypassDistance :: Lens' (WithCatchup indexer event) Word64 #

catchupBatchSize :: Lens' (WithCatchup indexer event) Word64 #

catchupEventHook :: Lens' (WithCatchup indexer event) (Maybe (CatchupEvent -> IO ())) #

withCatchup #

Arguments

:: (Point event -> event -> Word64)

The distance function

-> CatchupConfig

Configure how many element we put in a batch and until when we use it

-> indexer event

the underlying indexer

-> WithCatchup indexer event 

A smart constructor for WithCatchup

data CatchupConfig #

The visible part of the catchup configuration, it allows you to configure the size of the batch and to control when the batch mecanism stops

class HasCatchupConfig indexer where #

A typeclass that allows an indexer with a WitchCatchup transformer to configure the behaviour of this transformer

Methods

catchupBypassDistance :: Lens' (indexer event) Word64 #

catchupBatchSize :: Lens' (indexer event) Word64 #

catchupEventHook :: Lens' (indexer event) (Maybe (CatchupEvent -> IO ())) #

Instances

Instances details
HasCatchupConfig (WithCatchup indexer) # 
Instance details

Defined in Marconi.Core.Transformer.WithCatchup

Methods

catchupBypassDistance :: Lens' (WithCatchup indexer event) Word64 #

catchupBatchSize :: Lens' (WithCatchup indexer event) Word64 #

catchupEventHook :: Lens' (WithCatchup indexer event) (Maybe (CatchupEvent -> IO ())) #

(IndexerTrans t, HasCatchupConfig indexer) => HasCatchupConfig (t indexer) # 
Instance details

Defined in Marconi.Core.Transformer.WithCatchup

Methods

catchupBypassDistance :: Lens' (t indexer event) Word64 #

catchupBatchSize :: Lens' (t indexer event) Word64 #

catchupEventHook :: Lens' (t indexer event) (Maybe (CatchupEvent -> IO ())) #

(IndexerMapTrans t, HasCatchupConfig indexer) => HasCatchupConfig (t indexer output) # 
Instance details

Defined in Marconi.Core.Transformer.WithCatchup

Methods

catchupBypassDistance :: Lens' (t indexer output event) Word64 #

catchupBatchSize :: Lens' (t indexer output event) Word64 #

catchupEventHook :: Lens' (t indexer output event) (Maybe (CatchupEvent -> IO ())) #

data CatchupEvent #

Constructors

Synced