chore: add pipeline field docs and remove continous (#2550)

This commit is contained in:
Matthias Seitz
2023-05-04 19:50:38 +02:00
committed by GitHub
parent 6c21295b78
commit 209911c10c
2 changed files with 8 additions and 9 deletions

View File

@ -55,13 +55,6 @@ where
self
}
/// Tell the pipeline to continuously run the pipeline, to accomodate continuous syncing /
/// downloading.
pub fn with_continuous(mut self) -> Self {
self.pipeline.continuous = true;
self
}
/// Set the tip sender.
pub fn with_tip_sender(mut self, tip_tx: watch::Sender<H256>) -> Self {
self.pipeline.tip_tx = Some(tip_tx);

View File

@ -79,12 +79,19 @@ use sync_metrics::*;
/// pipeline will unwind the stages in reverse order of execution. It is also possible to
/// request an unwind manually (see [Pipeline::unwind]).
pub struct Pipeline<DB: Database> {
/// All configured stages in the order they will be executed.
stages: Vec<BoxedStage<DB>>,
/// The maximum block number to sync to.
max_block: Option<BlockNumber>,
continuous: bool,
/// All listeners for events the pipeline emits.
listeners: EventListeners<PipelineEvent>,
/// Used for emitting updates about whether the pipeline is running or not.
sync_state_updater: Box<dyn SyncStateUpdater>,
/// Keeps track of the progress of the pipeline.
progress: PipelineProgress,
/// A receiver for the current chain tip to sync to
///
/// Note: this is only used for debugging purposes.
tip_tx: Option<watch::Sender<H256>>,
metrics: Metrics,
}
@ -101,7 +108,6 @@ impl<DB: Database> Default for Pipeline<DB> {
Self {
stages: Vec::new(),
max_block: None,
continuous: false,
listeners: EventListeners::default(),
sync_state_updater: Box::<NoopSyncStateUpdate>::default(),
progress: PipelineProgress::default(),