pub enum Outcome {
Continue,
Retry {
after: Option<Duration>,
},
Backoff {
scope: Scope,
duration: Duration,
},
Abort(Scope),
Stop,
Fail(Error),
Fatal(Error),
}Expand description
What the crawler should do after a worker handled a request.
Variants§
Continue
The request is done.
Retry
Try the request again, after the given delay or the frontier’s default delay.
Backoff
Pause every request in scope for duration, then try this request
again. Typically returned on 429 Too Many Requests.
Abort(Scope)
Stop crawling scope: its queued requests are skipped from now on.
Returned on the first request of a tag, this drops the whole tag.
Stop
Stop the crawl: requests in flight finish, nothing new starts.
Fail(Error)
The request failed. Retryable errors are tried again, others are recorded as failures.
Fatal(Error)
Fail the crawl, returning the error after in-flight requests drain. No new work starts, and this failure is not retried.
Implementations§
Source§impl Outcome
impl Outcome
Sourcepub const fn retry_after(delay: Duration) -> Self
pub const fn retry_after(delay: Duration) -> Self
Retries the request after delay.
Sourcepub const fn backoff(duration: Duration) -> Self
pub const fn backoff(duration: Duration) -> Self
Pauses requests with the same tag as this one for duration.
Sourcepub fn backoff_tag(tag: impl Into<Tag>, duration: Duration) -> Self
pub fn backoff_tag(tag: impl Into<Tag>, duration: Duration) -> Self
Pauses requests with tag for duration.
Trait Implementations§
Source§impl From<&Outcome> for OutcomeKind
impl From<&Outcome> for OutcomeKind
Source§impl IntoOutcome for Outcome
impl IntoOutcome for Outcome
Source§fn into_outcome(self) -> Outcome
fn into_outcome(self) -> Outcome
self into an Outcome.