Skip to main content

RetryInterceptor

Trait RetryInterceptor 

pub trait RetryInterceptor:
    Send
    + Sync
    + 'static {
    // Required method
    fn intercept(&self, event: RetryEvent<'_>);
}
Expand description

RetryInterceptor is used to intercept while retry happened.

Required Methods§

fn intercept(&self, event: RetryEvent<'_>)

Everytime RetryLayer is retrying, this function will be called.

§Timing

just before the retry sleep.

§Notes

The intercept must be quick and non-blocking. No heavy IO is allowed. Otherwise, the retry will be blocked.

Implementors§