Skip to content

Commit

Permalink
Implement new methods in multiindexer
Browse files Browse the repository at this point in the history
  • Loading branch information
Sliman4 committed Dec 8, 2024
1 parent 66aefa1 commit ef45ba9
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/multiindexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@ impl<E: Debug + Send + Sync + 'static> Indexer for MultiIndexer<E> {
Ok(())
}

async fn process_block_end(&mut self, block: &StreamerMessage) -> Result<(), Self::Error> {
for indexer in self.indexers_mut() {
indexer.process_block_end(block).await?;
}
Ok(())
}

async fn finalize(&mut self) -> Result<(), Self::Error> {
for indexer in self.indexers_mut() {
indexer.finalize().await?;
Expand Down Expand Up @@ -262,6 +269,17 @@ impl<
.await
.map_err(&self.map)
}

async fn process_block_end(&mut self, block: &StreamerMessage) -> Result<(), Self::Error> {
self.indexer
.process_block_end(block)
.await
.map_err(&self.map)
}

async fn finalize(&mut self) -> Result<(), Self::Error> {
self.indexer.finalize().await.map_err(&self.map)
}
}

pub trait MapError {
Expand Down

0 comments on commit ef45ba9

Please sign in to comment.