mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
docs: add additional BasicPayloadJob docs (#13706)
This commit is contained in:
@ -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
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user