docs: add additional BasicPayloadJob docs (#13706)

This commit is contained in:
Matthias Seitz
2025-01-07 14:50:56 +01:00
committed by GitHub
parent d90d745aae
commit 3e86bb54d4
2 changed files with 11 additions and 0 deletions

View File

@ -295,6 +295,15 @@ impl Default for BasicPayloadJobGeneratorConfig {
}
/// A basic payload job that continuously builds a payload with the best transactions from the pool.
///
/// This type is a [`PayloadJob`] and [`Future`] that terminates when the deadline is reached or
/// when the job is resolved: [`PayloadJob::resolve`].
///
/// This basic job implementation will trigger new payload build task continuously until the job is
/// resolved or the deadline is reached, or until the built payload is marked as frozen:
/// [`BuildOutcome::Freeze`]. Once a frozen payload is returned, no additional payloads will be
/// built and this future will wait to be resolved: [`PayloadJob::resolve`] or terminated if the
/// deadline is reached..
#[derive(Debug)]
pub struct BasicPayloadJob<Client, Pool, Tasks, Builder>
where

View File

@ -67,6 +67,8 @@ pub trait PayloadJob: Future<Output = Result<(), PayloadBuilderError>> + Send +
) -> (Self::ResolvePayloadFuture, KeepPayloadJobAlive);
/// Resolves the payload as fast as possible.
///
/// See also [`PayloadJob::resolve_kind`]
fn resolve(&mut self) -> (Self::ResolvePayloadFuture, KeepPayloadJobAlive) {
self.resolve_kind(PayloadKind::Earliest)
}