Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix wrong method name #11441

Merged
merged 2 commits into from
Oct 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading