Skip to content

Commit

Permalink
docs: fix wrong method name (#11441)
Browse files Browse the repository at this point in the history
  • Loading branch information
kariy authored Oct 2, 2024
1 parent 70d498d commit 6b261db
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions crates/stages/api/src/stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,27 +199,27 @@ pub trait Stage<Provider>: Send + Sync {
/// Returns `Poll::Ready(Ok(()))` when the stage is ready to execute the given range.
///
/// This method is heavily inspired by [tower](https://crates.io/crates/tower)'s `Service` trait.
/// Any asynchronous tasks or communication should be handled in `poll_ready`, e.g. moving
/// downloaded items from downloaders to an internal buffer in the stage.
/// Any asynchronous tasks or communication should be handled in `poll_execute_ready`, e.g.
/// moving downloaded items from downloaders to an internal buffer in the stage.
///
/// If the stage has any pending external state, then `Poll::Pending` is returned.
///
/// If `Poll::Ready(Err(_))` is returned, the stage may not be able to execute anymore
/// depending on the specific error. In that case, an unwind must be issued instead.
///
/// Once `Poll::Ready(Ok(()))` is returned, the stage may be executed once using `execute`.
/// Until the stage has been executed, repeated calls to `poll_ready` must return either
/// Until the stage has been executed, repeated calls to `poll_execute_ready` must return either
/// `Poll::Ready(Ok(()))` or `Poll::Ready(Err(_))`.
///
/// Note that `poll_ready` may reserve shared resources that are consumed in a subsequent call
/// of `execute`, e.g. internal buffers. It is crucial for implementations to not assume that
/// `execute` will always be invoked and to ensure that those resources are appropriately
/// released if the stage is dropped before `execute` is called.
/// Note that `poll_execute_ready` may reserve shared resources that are consumed in a
/// subsequent call of `execute`, e.g. internal buffers. It is crucial for implementations
/// to not assume that `execute` will always be invoked and to ensure that those resources
/// are appropriately released if the stage is dropped before `execute` is called.
///
/// For the same reason, it is also important that any shared resources do not exhibit
/// unbounded growth on repeated calls to `poll_ready`.
/// unbounded growth on repeated calls to `poll_execute_ready`.
///
/// Unwinds may happen without consulting `poll_ready` first.
/// Unwinds may happen without consulting `poll_execute_ready` first.
fn poll_execute_ready(
&mut self,
_cx: &mut Context<'_>,
Expand Down

0 comments on commit 6b261db

Please sign in to comment.