id
stringlengths
22
133
text
stringlengths
40
40.2k
arch
stringclasses
1 value
syntax
stringclasses
1 value
kind
stringclasses
4 values
repo
stringclasses
27 values
path
stringlengths
5
116
license
stringclasses
6 values
commit
stringlengths
40
40
source_host
stringclasses
1 value
category
stringclasses
16 values
source_url
stringlengths
85
196
line_start
int64
1
4.28k
line_end
int64
4
4.31k
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:2
/// Create a new policy mechanism instance. fn new_request_policy(&self, sleep_impl: Option<Arc<dyn AsyncSleep>>) -> Self::Policy; } /// Retry Policy Configuration /// /// Without specific use cases, users should generally rely on the default values set /// by [`Config::default`](Config::default). /// /// Currentl...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
2b4a7b881b8735aad288284e1c140ed40f474d06
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/2b4a7b881b8735aad288284e1c140ed40f474d06/sdk/aws-smithy-client/src/retry.rs
41
100
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:4
base: fastrand::f64, initial_backoff: Duration::from_secs(1), } } } impl From<aws_smithy_types::retry::RetryConfig> for Config { fn from(conf: aws_smithy_types::retry::RetryConfig) -> Self { Self::default() .with_max_attempts(conf.max_attempts()) .with_initia...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
2b4a7b881b8735aad288284e1c140ed40f474d06
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/2b4a7b881b8735aad288284e1c140ed40f474d06/sdk/aws-smithy-client/src/retry.rs
121
180
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:5
self } } impl NewRequestPolicy for Standard { type Policy = RetryHandler; fn new_request_policy(&self, sleep_impl: Option<Arc<dyn AsyncSleep>>) -> Self::Policy { RetryHandler { local: RequestLocalRetryState::new(), shared: self.shared_state.clone(), config: self...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
2b4a7b881b8735aad288284e1c140ed40f474d06
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/2b4a7b881b8735aad288284e1c140ed40f474d06/sdk/aws-smithy-client/src/retry.rs
161
220
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:7
} else { config.retry_cost }; if retry_cost > *quota { None } else { *quota -= retry_cost; Some(retry_cost) } } } type BoxFuture<T> = Pin<Box<dyn Future<Output = T> + Send>>; /// RetryHandler /// /// Implement retries for an individua...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
2b4a7b881b8735aad288284e1c140ed40f474d06
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/2b4a7b881b8735aad288284e1c140ed40f474d06/sdk/aws-smithy-client/src/retry.rs
241
300
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:5
self } } impl NewRequestPolicy for Standard { type Policy = RetryHandler; fn new_request_policy(&self, sleep_impl: Option<Arc<dyn AsyncSleep>>) -> Self::Policy { RetryHandler { local: RequestLocalRetryState::new(), shared: self.shared_state.clone(), config: self...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
8657f207e05add10eb5b9d0faaa17522e42a3f84
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/8657f207e05add10eb5b9d0faaa17522e42a3f84/sdk/aws-smithy-client/src/retry.rs
161
220
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:6
pub fn new() -> Self { Self::default() } } /* TODO(retries) /// RetryPartition represents a scope for cross request retry state /// /// For example, a retry partition could be the id of a service. This would give each service a separate retry budget. struct RetryPartition(Cow<'static, str>); */ /// Shared...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
8657f207e05add10eb5b9d0faaa17522e42a3f84
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/8657f207e05add10eb5b9d0faaa17522e42a3f84/sdk/aws-smithy-client/src/retry.rs
201
260
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:1
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ //! Retry support //! //! Components: //! - [`Standard`]: Top level manager, intended to be associated with a [`Client`](crate::Client). //! Its sole purpose in life is to create a [`RetryHandler`] for...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
779b626cc64b91662a3cb42192575aad7f08ae03
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/779b626cc64b91662a3cb42192575aad7f08ae03/sdk/aws-smithy-client/src/retry.rs
1
60
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:2
/// Create a new policy mechanism instance. fn new_request_policy(&self, sleep_impl: Option<Arc<dyn AsyncSleep>>) -> Self::Policy; } /// Retry Policy Configuration /// /// Without specific use cases, users should generally rely on the default values set /// by [`Config::default`](Config::default). /// /// Currentl...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
779b626cc64b91662a3cb42192575aad7f08ae03
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/779b626cc64b91662a3cb42192575aad7f08ae03/sdk/aws-smithy-client/src/retry.rs
41
100
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:3
pub fn with_max_attempts(mut self, max_attempts: u32) -> Self { self.max_attempts = max_attempts; self } /// Override the default backoff multiplier of 1 second. /// /// ## Example /// /// For a request that gets retried 3 times, when initial_backoff is 1 second: /// - the f...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
779b626cc64b91662a3cb42192575aad7f08ae03
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/779b626cc64b91662a3cb42192575aad7f08ae03/sdk/aws-smithy-client/src/retry.rs
81
140
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:4
initial_backoff: Duration::from_secs(1), } } } impl From<aws_smithy_types::retry::RetryConfig> for Config { fn from(conf: aws_smithy_types::retry::RetryConfig) -> Self { Self::default() .with_max_attempts(conf.max_attempts()) .with_initial_backoff(conf.initial_backoff())...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
779b626cc64b91662a3cb42192575aad7f08ae03
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/779b626cc64b91662a3cb42192575aad7f08ae03/sdk/aws-smithy-client/src/retry.rs
121
180
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:5
} } impl NewRequestPolicy for Standard { type Policy = RetryHandler; fn new_request_policy(&self, sleep_impl: Option<Arc<dyn AsyncSleep>>) -> Self::Policy { RetryHandler { local: RequestLocalRetryState::new(), shared: self.shared_state.clone(), config: self.config.c...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
779b626cc64b91662a3cb42192575aad7f08ae03
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/779b626cc64b91662a3cb42192575aad7f08ae03/sdk/aws-smithy-client/src/retry.rs
161
220
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:6
Self::default() } } /* TODO(retries) /// RetryPartition represents a scope for cross request retry state /// /// For example, a retry partition could be the id of a service. This would give each service a separate retry budget. struct RetryPartition(Cow<'static, str>); */ /// Shared state between multiple request...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
779b626cc64b91662a3cb42192575aad7f08ae03
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/779b626cc64b91662a3cb42192575aad7f08ae03/sdk/aws-smithy-client/src/retry.rs
201
260
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:7
config.retry_cost }; if retry_cost > *quota { None } else { *quota -= retry_cost; Some(retry_cost) } } } type BoxFuture<T> = Pin<Box<dyn Future<Output = T> + Send>>; /// RetryHandler /// /// Implement retries for an individual request. /// It is ...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
779b626cc64b91662a3cb42192575aad7f08ae03
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/779b626cc64b91662a3cb42192575aad7f08ae03/sdk/aws-smithy-client/src/retry.rs
241
300
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:8
/// - the second retry will occur after 0 to 60 milliseconds /// - the third retry will occur after 0 to 120 milliseconds fn calculate_exponential_backoff(base: f64, initial_backoff: f64, retry_attempts: u32) -> f64 { base * initial_backoff * 2_u32.pow(retry_attempts) as f64 } impl RetryHandler { /// Determine...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
779b626cc64b91662a3cb42192575aad7f08ae03
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/779b626cc64b91662a3cb42192575aad7f08ae03/sdk/aws-smithy-client/src/retry.rs
281
340
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:9
fn should_retry(&self, retry_kind: &RetryKind) -> Option<(Self, Duration)> { match retry_kind { RetryKind::Explicit(dur) => Some((self.clone(), *dur)), RetryKind::UnretryableFailure => None, RetryKind::Unnecessary => { self.shared .quota_re...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
779b626cc64b91662a3cb42192575aad7f08ae03
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/779b626cc64b91662a3cb42192575aad7f08ae03/sdk/aws-smithy-client/src/retry.rs
321
380
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:10
Some(check_send(Box::pin(fut))) } } impl<Handler, R, T, E> tower::retry::Policy<Operation<Handler, R>, SdkSuccess<T>, SdkError<E>> for RetryHandler where Handler: Clone, R: ClassifyRetry<SdkSuccess<T>, SdkError<E>>, { type Future = BoxFuture<Self>; fn retry( &self, req: &Operat...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
779b626cc64b91662a3cb42192575aad7f08ae03
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/779b626cc64b91662a3cb42192575aad7f08ae03/sdk/aws-smithy-client/src/retry.rs
361
420
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:11
Config::default().with_base(|| 1_f64) } #[test] fn retry_handler_send_sync() { fn must_be_send_sync<T: Send + Sync>() {} must_be_send_sync::<RetryHandler>() } #[test] fn eventual_success() { let policy = Standard::new(test_config()).new_request_policy(None); le...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
779b626cc64b91662a3cb42192575aad7f08ae03
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/779b626cc64b91662a3cb42192575aad7f08ae03/sdk/aws-smithy-client/src/retry.rs
401
460
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:12
.should_retry(&RetryKind::Error(ErrorKind::ServerError)) .expect("should retry"); assert_eq!(dur, Duration::from_secs(2)); assert_eq!(policy.retry_quota(), 490); let no_retry = policy.should_retry(&RetryKind::Error(ErrorKind::ServerError)); assert!(no_retry.is_none()); ...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
779b626cc64b91662a3cb42192575aad7f08ae03
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/779b626cc64b91662a3cb42192575aad7f08ae03/sdk/aws-smithy-client/src/retry.rs
441
500
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:13
.expect("should retry"); assert_eq!(dur, Duration::from_secs(1)); assert_eq!( policy.retry_quota(), 90, "explicit retry should not subtract from quota" ); assert!( policy.should_retry(&RetryKind::Unnecessary).is_none(), "it sho...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
779b626cc64b91662a3cb42192575aad7f08ae03
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/779b626cc64b91662a3cb42192575aad7f08ae03/sdk/aws-smithy-client/src/retry.rs
481
540
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:14
.should_retry(&RetryKind::Error(ErrorKind::ServerError)) .expect("should retry"); assert_eq!(dur, Duration::from_secs(8)); assert_eq!(policy.retry_quota(), 480); let no_retry = policy.should_retry(&RetryKind::Error(ErrorKind::ServerError)); assert!(no_retry.is_none()); ...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
779b626cc64b91662a3cb42192575aad7f08ae03
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/779b626cc64b91662a3cb42192575aad7f08ae03/sdk/aws-smithy-client/src/retry.rs
521
580
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:15
let no_retry = policy.should_retry(&RetryKind::Error(ErrorKind::ServerError)); assert!(no_retry.is_none()); assert_eq!(policy.retry_quota(), 480); } #[test] fn calculate_exponential_backoff_where_initial_backoff_is_one() { let initial_backoff = 1.0; for (attempt, expected_b...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
779b626cc64b91662a3cb42192575aad7f08ae03
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/779b626cc64b91662a3cb42192575aad7f08ae03/sdk/aws-smithy-client/src/retry.rs
561
599
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:1
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ //! Retry support //! //! Components: //! - [`Standard`]: Top level manager, intended to be associated with a [`Client`](crate::Client). //! Its sole purpose in life is to create a [`RetryHandler`] for...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
d5e2a4e47b1005b617c74597cba6385536e16978
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/d5e2a4e47b1005b617c74597cba6385536e16978/sdk/aws-smithy-client/src/retry.rs
1
60
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:2
/// Create a new policy mechanism instance. fn new_request_policy(&self, sleep_impl: Option<Arc<dyn AsyncSleep>>) -> Self::Policy; } /// Retry Policy Configuration /// /// Without specific use cases, users should generally rely on the default values set by `[Config::default]`(Config::default).` /// /// Currently t...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
d5e2a4e47b1005b617c74597cba6385536e16978
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/d5e2a4e47b1005b617c74597cba6385536e16978/sdk/aws-smithy-client/src/retry.rs
41
100
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:3
self } /// Override the default backoff multiplier of 1 second. /// /// ## Example /// /// For a request that gets retried 3 times, when initial_backoff is 1 second: /// - the first retry will occur after 0 to 1 seconds /// - the second retry will occur after 0 to 2 seconds /// - th...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
d5e2a4e47b1005b617c74597cba6385536e16978
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/d5e2a4e47b1005b617c74597cba6385536e16978/sdk/aws-smithy-client/src/retry.rs
81
140
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:4
} } impl From<aws_smithy_types::retry::RetryConfig> for Config { fn from(conf: aws_smithy_types::retry::RetryConfig) -> Self { Self::default() .with_max_attempts(conf.max_attempts()) .with_initial_backoff(conf.initial_backoff()) } } const MAX_ATTEMPTS: u32 = 3; const INITIAL_RE...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
d5e2a4e47b1005b617c74597cba6385536e16978
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/d5e2a4e47b1005b617c74597cba6385536e16978/sdk/aws-smithy-client/src/retry.rs
121
180
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:5
impl NewRequestPolicy for Standard { type Policy = RetryHandler; fn new_request_policy(&self, sleep_impl: Option<Arc<dyn AsyncSleep>>) -> Self::Policy { RetryHandler { local: RequestLocalRetryState::new(), shared: self.shared_state.clone(), config: self.config.clone(...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
d5e2a4e47b1005b617c74597cba6385536e16978
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/d5e2a4e47b1005b617c74597cba6385536e16978/sdk/aws-smithy-client/src/retry.rs
161
220
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:6
} /* TODO(retries) /// RetryPartition represents a scope for cross request retry state /// /// For example, a retry partition could be the id of a service. This would give each service a separate retry budget. struct RetryPartition(Cow<'static, str>); */ /// Shared state between multiple requests to the same client. ...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
d5e2a4e47b1005b617c74597cba6385536e16978
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/d5e2a4e47b1005b617c74597cba6385536e16978/sdk/aws-smithy-client/src/retry.rs
201
260
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:7
if retry_cost > *quota { None } else { *quota -= retry_cost; Some(retry_cost) } } } type BoxFuture<T> = Pin<Box<dyn Future<Output = T> + Send>>; /// RetryHandler /// /// Implement retries for an individual request. /// It is intended to be used as a [Tower Retry...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
d5e2a4e47b1005b617c74597cba6385536e16978
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/d5e2a4e47b1005b617c74597cba6385536e16978/sdk/aws-smithy-client/src/retry.rs
241
300
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:8
fn calculate_exponential_backoff(base: f64, initial_backoff: f64, retry_attempts: u32) -> f64 { base * initial_backoff * 2_u32.pow(retry_attempts) as f64 } impl RetryHandler { /// Determine the correct response given `retry_kind` /// /// If a retry is specified, this function returns `(next, backoff_du...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
d5e2a4e47b1005b617c74597cba6385536e16978
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/d5e2a4e47b1005b617c74597cba6385536e16978/sdk/aws-smithy-client/src/retry.rs
281
340
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:9
match retry_kind { RetryKind::Explicit(dur) => Some((self.clone(), *dur)), RetryKind::UnretryableFailure => None, RetryKind::Unnecessary => { self.shared .quota_release(self.local.last_quota_usage, &self.config); None } ...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
d5e2a4e47b1005b617c74597cba6385536e16978
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/d5e2a4e47b1005b617c74597cba6385536e16978/sdk/aws-smithy-client/src/retry.rs
321
380
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:10
} impl<Handler, R, T, E> tower::retry::Policy<Operation<Handler, R>, SdkSuccess<T>, SdkError<E>> for RetryHandler where Handler: Clone, R: ClassifyRetry<SdkSuccess<T>, SdkError<E>>, { type Future = BoxFuture<Self>; fn retry( &self, req: &Operation<Handler, R>, result: Resul...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
d5e2a4e47b1005b617c74597cba6385536e16978
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/d5e2a4e47b1005b617c74597cba6385536e16978/sdk/aws-smithy-client/src/retry.rs
361
420
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:11
#[test] fn retry_handler_send_sync() { fn must_be_send_sync<T: Send + Sync>() {} must_be_send_sync::<RetryHandler>() } #[test] fn eventual_success() { let policy = Standard::new(test_config()).new_request_policy(None); let (policy, dur) = policy .should_retr...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
d5e2a4e47b1005b617c74597cba6385536e16978
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/d5e2a4e47b1005b617c74597cba6385536e16978/sdk/aws-smithy-client/src/retry.rs
401
460
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:12
assert_eq!(dur, Duration::from_secs(2)); assert_eq!(policy.retry_quota(), 490); let no_retry = policy.should_retry(&RetryKind::Error(ErrorKind::ServerError)); assert!(no_retry.is_none()); assert_eq!(policy.retry_quota(), 490); } #[test] fn no_quota() { let mut conf ...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
d5e2a4e47b1005b617c74597cba6385536e16978
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/d5e2a4e47b1005b617c74597cba6385536e16978/sdk/aws-smithy-client/src/retry.rs
441
500
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:13
assert_eq!( policy.retry_quota(), 90, "explicit retry should not subtract from quota" ); assert!( policy.should_retry(&RetryKind::Unnecessary).is_none(), "it should not retry success" ); let available = policy.shared.quota_avai...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
d5e2a4e47b1005b617c74597cba6385536e16978
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/d5e2a4e47b1005b617c74597cba6385536e16978/sdk/aws-smithy-client/src/retry.rs
481
540
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:14
assert_eq!(dur, Duration::from_secs(8)); assert_eq!(policy.retry_quota(), 480); let no_retry = policy.should_retry(&RetryKind::Error(ErrorKind::ServerError)); assert!(no_retry.is_none()); assert_eq!(policy.retry_quota(), 480); } #[test] fn max_backoff_time() { let m...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
d5e2a4e47b1005b617c74597cba6385536e16978
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/d5e2a4e47b1005b617c74597cba6385536e16978/sdk/aws-smithy-client/src/retry.rs
521
580
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:15
assert!(no_retry.is_none()); assert_eq!(policy.retry_quota(), 480); } #[test] fn calculate_exponential_backoff_where_initial_backoff_is_one() { let initial_backoff = 1.0; for (attempt, expected_backoff) in [initial_backoff, 2.0, 4.0].into_iter().enumerate() { let actual...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
d5e2a4e47b1005b617c74597cba6385536e16978
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/d5e2a4e47b1005b617c74597cba6385536e16978/sdk/aws-smithy-client/src/retry.rs
561
597
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:9
match retry_kind { RetryKind::Explicit(dur) => Some((self.clone(), *dur)), RetryKind::UnretryableFailure => None, RetryKind::Unnecessary => { self.shared .quota_release(self.local.last_quota_usage, &self.config); None } ...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
d9b0e139d03bb5cdd990998dda0cf2a79f151e99
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/d9b0e139d03bb5cdd990998dda0cf2a79f151e99/sdk/aws-smithy-client/src/retry.rs
321
380
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:1
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ //! Retry support //! //! Components: //! - [`Standard`]: Top level manager, intended to be associated with a [`Client`](crate::Client). //! Its sole purpose in life is to create a [`RetryHandler`] for...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
7f9cfeccad54627973c04554ca91de9529639c8a
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/7f9cfeccad54627973c04554ca91de9529639c8a/sdk/aws-smithy-client/src/retry.rs
1
60
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:9
match retry_kind { RetryKind::Explicit(dur) => Some((self.clone(), *dur)), RetryKind::UnretryableFailure => None, RetryKind::Unnecessary => { self.shared .quota_release(self.local.last_quota_usage, &self.config); None } ...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
7f9cfeccad54627973c04554ca91de9529639c8a
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/7f9cfeccad54627973c04554ca91de9529639c8a/sdk/aws-smithy-client/src/retry.rs
321
380
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:10
} impl<Handler, R, T, E> tower::retry::Policy<Operation<Handler, R>, SdkSuccess<T>, SdkError<E>> for RetryHandler where Handler: Clone, R: ClassifyResponse<SdkSuccess<T>, SdkError<E>>, { type Future = BoxFuture<Self>; fn retry( &self, req: &Operation<Handler, R>, result: Re...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
7f9cfeccad54627973c04554ca91de9529639c8a
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/7f9cfeccad54627973c04554ca91de9529639c8a/sdk/aws-smithy-client/src/retry.rs
361
420
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:1
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ //! Retry support for aws-hyper //! //! The actual retry policy implementation will likely be replaced //! with the CRT implementation once the bindings exist. This //! implementation is intended to be _...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
b251c9b4eb560880b69d9fb2ff9d50751a08b286
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/b251c9b4eb560880b69d9fb2ff9d50751a08b286/sdk/aws-smithy-client/src/retry.rs
1
60
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:2
{ /// The type of the per-request policy mechanism. type Policy; /// Create a new policy mechanism instance. fn new_request_policy(&self, sleep_impl: Option<Arc<dyn AsyncSleep>>) -> Self::Policy; } /// Retry Policy Configuration /// /// Without specific use cases, users should generally rely on the de...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
b251c9b4eb560880b69d9fb2ff9d50751a08b286
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/b251c9b4eb560880b69d9fb2ff9d50751a08b286/sdk/aws-smithy-client/src/retry.rs
41
100
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:3
/// /// `max_attempts` must be set to a value of at least `1` (indicating that retries are disabled). pub fn with_max_attempts(mut self, max_attempts: u32) -> Self { self.max_attempts = max_attempts; self } /// Override the default backoff multiplier of 1 second. /// /// ## Exam...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
b251c9b4eb560880b69d9fb2ff9d50751a08b286
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/b251c9b4eb560880b69d9fb2ff9d50751a08b286/sdk/aws-smithy-client/src/retry.rs
81
140
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:4
} impl From<aws_smithy_types::retry::RetryConfig> for Config { fn from(conf: aws_smithy_types::retry::RetryConfig) -> Self { Self::default() .with_max_attempts(conf.max_attempts()) .with_initial_backoff(conf.initial_backoff()) } } const MAX_ATTEMPTS: u32 = 3; const INITIAL_RETR...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
b251c9b4eb560880b69d9fb2ff9d50751a08b286
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/b251c9b4eb560880b69d9fb2ff9d50751a08b286/sdk/aws-smithy-client/src/retry.rs
121
180
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:5
self.config = config; self } } impl NewRequestPolicy for Standard { type Policy = RetryHandler; fn new_request_policy(&self, sleep_impl: Option<Arc<dyn AsyncSleep>>) -> Self::Policy { RetryHandler { local: RequestLocalRetryState::new(), shared: self.shared_state.clo...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
b251c9b4eb560880b69d9fb2ff9d50751a08b286
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/b251c9b4eb560880b69d9fb2ff9d50751a08b286/sdk/aws-smithy-client/src/retry.rs
161
220
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:6
impl RequestLocalRetryState { pub fn new() -> Self { Self::default() } } /* TODO(retries) /// RetryPartition represents a scope for cross request retry state /// /// For example, a retry partition could be the id of a service. This would give each service a separate retry budget. struct RetryPartition(...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
b251c9b4eb560880b69d9fb2ff9d50751a08b286
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/b251c9b4eb560880b69d9fb2ff9d50751a08b286/sdk/aws-smithy-client/src/retry.rs
201
260
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:7
config.timeout_retry_cost } else { config.retry_cost }; if retry_cost > *quota { None } else { *quota -= retry_cost; Some(retry_cost) } } } type BoxFuture<T> = Pin<Box<dyn Future<Output = T> + Send>>; /// RetryHandler /// /// ...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
b251c9b4eb560880b69d9fb2ff9d50751a08b286
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/b251c9b4eb560880b69d9fb2ff9d50751a08b286/sdk/aws-smithy-client/src/retry.rs
241
300
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:8
/// For a request that gets retried 3 times, when base is 1 and initial_backoff is 30 milliseconds: /// - the first retry will occur after 0 to 30 milliseconds /// - the second retry will occur after 0 to 60 milliseconds /// - the third retry will occur after 0 to 120 milliseconds fn calculate_exponential_backoff(base:...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
b251c9b4eb560880b69d9fb2ff9d50751a08b286
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/b251c9b4eb560880b69d9fb2ff9d50751a08b286/sdk/aws-smithy-client/src/retry.rs
281
340
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:9
Some((next, backoff)) } fn should_retry(&self, retry_kind: &RetryKind) -> Option<(Self, Duration)> { match retry_kind { RetryKind::Explicit(dur) => Some((self.clone(), *dur)), RetryKind::UnretryableFailure => None, RetryKind::Unnecessary => { self.sha...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
b251c9b4eb560880b69d9fb2ff9d50751a08b286
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/b251c9b4eb560880b69d9fb2ff9d50751a08b286/sdk/aws-smithy-client/src/retry.rs
321
380
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:10
} .instrument(tracing::info_span!("retry", kind = &debug(retry_kind))); Some(check_send(Box::pin(fut))) } } impl<Handler, R, T, E> tower::retry::Policy<Operation<Handler, R>, SdkSuccess<T>, SdkError<E>> for RetryHandler where Handler: Clone, R: ClassifyResponse<SdkSuccess<T>, SdkError<E...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
b251c9b4eb560880b69d9fb2ff9d50751a08b286
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/b251c9b4eb560880b69d9fb2ff9d50751a08b286/sdk/aws-smithy-client/src/retry.rs
361
420
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:11
fn test_config() -> Config { Config::default().with_base(|| 1_f64) } #[test] fn retry_handler_send_sync() { fn must_be_send_sync<T: Send + Sync>() {} must_be_send_sync::<RetryHandler>() } #[test] fn eventual_success() { let policy = Standard::new(test_config())...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
b251c9b4eb560880b69d9fb2ff9d50751a08b286
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/b251c9b4eb560880b69d9fb2ff9d50751a08b286/sdk/aws-smithy-client/src/retry.rs
401
460
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:12
let (policy, dur) = policy .should_retry(&RetryKind::Error(ErrorKind::ServerError)) .expect("should retry"); assert_eq!(dur, Duration::from_secs(2)); assert_eq!(policy.retry_quota(), 490); let no_retry = policy.should_retry(&RetryKind::Error(ErrorKind::ServerError)); ...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
b251c9b4eb560880b69d9fb2ff9d50751a08b286
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/b251c9b4eb560880b69d9fb2ff9d50751a08b286/sdk/aws-smithy-client/src/retry.rs
441
500
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:13
let (policy, dur) = policy .should_retry(&RetryKind::Explicit(Duration::from_secs(1))) .expect("should retry"); assert_eq!(dur, Duration::from_secs(1)); assert_eq!( policy.retry_quota(), 90, "explicit retry should not subtract from quota" ...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
b251c9b4eb560880b69d9fb2ff9d50751a08b286
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/b251c9b4eb560880b69d9fb2ff9d50751a08b286/sdk/aws-smithy-client/src/retry.rs
481
540
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:14
let (policy, dur) = policy .should_retry(&RetryKind::Error(ErrorKind::ServerError)) .expect("should retry"); assert_eq!(dur, Duration::from_secs(8)); assert_eq!(policy.retry_quota(), 480); let no_retry = policy.should_retry(&RetryKind::Error(ErrorKind::ServerError)); ...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
b251c9b4eb560880b69d9fb2ff9d50751a08b286
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/b251c9b4eb560880b69d9fb2ff9d50751a08b286/sdk/aws-smithy-client/src/retry.rs
521
580
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:15
assert_eq!(dur, Duration::from_secs(3)); assert_eq!(policy.retry_quota(), 480); let no_retry = policy.should_retry(&RetryKind::Error(ErrorKind::ServerError)); assert!(no_retry.is_none()); assert_eq!(policy.retry_quota(), 480); } #[test] fn calculate_exponential_backoff_wher...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
b251c9b4eb560880b69d9fb2ff9d50751a08b286
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/b251c9b4eb560880b69d9fb2ff9d50751a08b286/sdk/aws-smithy-client/src/retry.rs
561
601
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:1
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ //! Retry support for aws-hyper //! //! The actual retry policy implementation will likely be replaced //! with the CRT implementation once the bindings exist. This //! implementation is intended to be _...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
8159cb8ff570e4dca718e354c31cecdfadfeb0b8
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/8159cb8ff570e4dca718e354c31cecdfadfeb0b8/sdk/aws-smithy-client/src/retry.rs
1
60
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:2
/// The type of the per-request policy mechanism. type Policy; /// Create a new policy mechanism instance. fn new_request_policy(&self, sleep_impl: Option<Arc<dyn AsyncSleep>>) -> Self::Policy; } /// Retry Policy Configuration /// /// Without specific use cases, users should generally rely on the default ...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
8159cb8ff570e4dca718e354c31cecdfadfeb0b8
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/8159cb8ff570e4dca718e354c31cecdfadfeb0b8/sdk/aws-smithy-client/src/retry.rs
41
100
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:3
pub fn with_max_attempts(mut self, max_attempts: u32) -> Self { self.max_attempts = max_attempts; self } } impl Default for Config { fn default() -> Self { Self { initial_retry_tokens: INITIAL_RETRY_TOKENS, retry_cost: RETRY_COST, no_retry_increment: ...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
8159cb8ff570e4dca718e354c31cecdfadfeb0b8
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/8159cb8ff570e4dca718e354c31cecdfadfeb0b8/sdk/aws-smithy-client/src/retry.rs
81
140
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:4
#[derive(Debug, Clone)] pub struct Standard { config: Config, shared_state: CrossRequestRetryState, } impl Standard { /// Construct a new standard retry policy from the given policy configuration. pub fn new(config: Config) -> Self { Self { shared_state: CrossRequestRetryState::new(...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
8159cb8ff570e4dca718e354c31cecdfadfeb0b8
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/8159cb8ff570e4dca718e354c31cecdfadfeb0b8/sdk/aws-smithy-client/src/retry.rs
121
180
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:5
#[derive(Clone, Debug)] struct RequestLocalRetryState { attempts: u32, last_quota_usage: Option<usize>, } impl Default for RequestLocalRetryState { fn default() -> Self { Self { // Starts at one to account for the initial request that failed and warranted a retry attempts: 1...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
8159cb8ff570e4dca718e354c31cecdfadfeb0b8
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/8159cb8ff570e4dca718e354c31cecdfadfeb0b8/sdk/aws-smithy-client/src/retry.rs
161
220
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:6
Self { quota_available: Arc::new(Mutex::new(initial_quota)), } } fn quota_release(&self, value: Option<usize>, config: &Config) { let mut quota = self.quota_available.lock().unwrap(); *quota += value.unwrap_or(config.no_retry_increment); } /// Attempt to acquire ret...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
8159cb8ff570e4dca718e354c31cecdfadfeb0b8
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/8159cb8ff570e4dca718e354c31cecdfadfeb0b8/sdk/aws-smithy-client/src/retry.rs
201
260
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:7
shared: CrossRequestRetryState, config: Config, sleep_impl: Option<Arc<dyn AsyncSleep>>, } #[cfg(test)] impl RetryHandler { fn retry_quota(&self) -> usize { *self.shared.quota_available.lock().unwrap() } } impl RetryHandler { /// Determine the correct response given `retry_kind` /// ...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
8159cb8ff570e4dca718e354c31cecdfadfeb0b8
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/8159cb8ff570e4dca718e354c31cecdfadfeb0b8/sdk/aws-smithy-client/src/retry.rs
241
300
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:8
}, shared: self.shared.clone(), config: self.config.clone(), sleep_impl: self.sleep_impl.clone(), }; Some((next, backoff)) } fn should_retry(&self, retry_kind: &RetryKind) -> Option<(Self, Duration)> { match retry_kind { RetryKind::Explic...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
8159cb8ff570e4dca718e354c31cecdfadfeb0b8
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/8159cb8ff570e4dca718e354c31cecdfadfeb0b8/sdk/aws-smithy-client/src/retry.rs
281
340
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:9
dur ); let sleep_future = sleep.sleep(dur); let fut = async move { sleep_future.await; next } .instrument(tracing::info_span!("retry", kind = &debug(retry_kind))); Some(check_send(Box::pin(fut))) } } impl<Handler, R, T, E> tower::retry::Po...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
8159cb8ff570e4dca718e354c31cecdfadfeb0b8
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/8159cb8ff570e4dca718e354c31cecdfadfeb0b8/sdk/aws-smithy-client/src/retry.rs
321
380
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:10
#[cfg(test)] mod test { use crate::retry::{Config, NewRequestPolicy, RetryHandler, Standard}; use aws_smithy_types::retry::{ErrorKind, RetryKind}; use std::time::Duration; fn test_config() -> Config { Config::default().with_base(|| 1_f64) } #[test] fn retry_handler_send_sync() {...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
8159cb8ff570e4dca718e354c31cecdfadfeb0b8
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/8159cb8ff570e4dca718e354c31cecdfadfeb0b8/sdk/aws-smithy-client/src/retry.rs
361
420
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:11
#[test] fn no_more_attempts() { let policy = Standard::new(test_config()).new_request_policy(None); let (policy, dur) = policy .should_retry(&RetryKind::Error(ErrorKind::ServerError)) .expect("should retry"); assert_eq!(dur, Duration::from_secs(1)); assert_eq!...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
8159cb8ff570e4dca718e354c31cecdfadfeb0b8
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/8159cb8ff570e4dca718e354c31cecdfadfeb0b8/sdk/aws-smithy-client/src/retry.rs
401
460
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:12
conf.initial_retry_tokens = 100; let policy = Standard::new(conf).new_request_policy(None); let (policy, dur) = policy .should_retry(&RetryKind::Error(ErrorKind::TransientError)) .expect("should retry"); assert_eq!(dur, Duration::from_secs(1)); assert_eq!(policy.r...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
8159cb8ff570e4dca718e354c31cecdfadfeb0b8
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/8159cb8ff570e4dca718e354c31cecdfadfeb0b8/sdk/aws-smithy-client/src/retry.rs
441
500
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:13
assert_eq!(dur, Duration::from_secs(2)); assert_eq!(policy.retry_quota(), 490); let (policy, dur) = policy .should_retry(&RetryKind::Error(ErrorKind::ServerError)) .expect("should retry"); assert_eq!(dur, Duration::from_secs(4)); assert_eq!(policy.retry_quota(), ...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
8159cb8ff570e4dca718e354c31cecdfadfeb0b8
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/8159cb8ff570e4dca718e354c31cecdfadfeb0b8/sdk/aws-smithy-client/src/retry.rs
481
535
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:14
.expect("should retry"); assert_eq!(dur, Duration::from_secs(3)); assert_eq!(policy.retry_quota(), 485); let (policy, dur) = policy .should_retry(&RetryKind::Error(ErrorKind::ServerError)) .expect("should retry"); assert_eq!(dur, Duration::from_secs(3)); ...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
8159cb8ff570e4dca718e354c31cecdfadfeb0b8
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/8159cb8ff570e4dca718e354c31cecdfadfeb0b8/sdk/aws-smithy-client/src/retry.rs
521
535
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:1
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ //! Retry support for aws-hyper //! //! The actual retry policy implementation will likely be replaced //! with the CRT implementation once the bindings exist. This //! implementation is intended to be ...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
89af12eb02a3108d2cb25cd5339430ba1f08ad51
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/89af12eb02a3108d2cb25cd5339430ba1f08ad51/sdk/aws-smithy-client/src/retry.rs
1
60
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:8
}, shared: self.shared.clone(), config: self.config.clone(), sleep_impl: self.sleep_impl.clone(), }; Some((next, backoff)) } fn should_retry(&self, retry_kind: &RetryKind) -> Option<(Self, Duration)> { match retry_kind { RetryKind::Explic...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
f886db64dcf9a331eb1be7e4809ba9ca792add23
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/f886db64dcf9a331eb1be7e4809ba9ca792add23/sdk/aws-smithy-client/src/retry.rs
281
340
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:9
.instrument(tracing::info_span!("retry", kind = &debug(retry_kind))); Some(check_send(Box::pin(fut))) } } impl<Handler, R, T, E> tower::retry::Policy<operation::Operation<Handler, R>, SdkSuccess<T>, SdkError<E>> for RetryHandler where Handler: Clone, R: ClassifyResponse<SdkSuccess<T>, SdkEr...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
f886db64dcf9a331eb1be7e4809ba9ca792add23
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/f886db64dcf9a331eb1be7e4809ba9ca792add23/sdk/aws-smithy-client/src/retry.rs
321
380
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:10
use std::time::Duration; fn test_config() -> Config { Config::default().with_base(|| 1_f64) } #[test] fn retry_handler_send_sync() { fn must_be_send_sync<T: Send + Sync>() {} must_be_send_sync::<RetryHandler>() } #[test] fn eventual_success() { let policy ...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
f886db64dcf9a331eb1be7e4809ba9ca792add23
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/f886db64dcf9a331eb1be7e4809ba9ca792add23/sdk/aws-smithy-client/src/retry.rs
361
420
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:11
assert_eq!(policy.retry_quota(), 495); let (policy, dur) = policy .should_retry(&RetryKind::Error(ErrorKind::ServerError)) .expect("should retry"); assert_eq!(dur, Duration::from_secs(2)); assert_eq!(policy.retry_quota(), 490); let no_retry = policy.should_retry...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
f886db64dcf9a331eb1be7e4809ba9ca792add23
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/f886db64dcf9a331eb1be7e4809ba9ca792add23/sdk/aws-smithy-client/src/retry.rs
401
460
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:12
let (policy, dur) = policy .should_retry(&RetryKind::Explicit(Duration::from_secs(1))) .expect("should retry"); assert_eq!(dur, Duration::from_secs(1)); assert_eq!( policy.retry_quota(), 90, "explicit retry should not subtract from quota" ...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
f886db64dcf9a331eb1be7e4809ba9ca792add23
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/f886db64dcf9a331eb1be7e4809ba9ca792add23/sdk/aws-smithy-client/src/retry.rs
441
500
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:13
assert_eq!(policy.retry_quota(), 485); let (policy, dur) = policy .should_retry(&RetryKind::Error(ErrorKind::ServerError)) .expect("should retry"); assert_eq!(dur, Duration::from_secs(8)); assert_eq!(policy.retry_quota(), 480); let no_retry = policy.should_retry...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
f886db64dcf9a331eb1be7e4809ba9ca792add23
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/f886db64dcf9a331eb1be7e4809ba9ca792add23/sdk/aws-smithy-client/src/retry.rs
481
528
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:6
Self { quota_available: Arc::new(Mutex::new(initial_quota)), } } fn quota_release(&self, value: Option<usize>, config: &Config) { let mut quota = self.quota_available.lock().unwrap(); *quota += value.unwrap_or(config.no_retry_increment); } /// Attempt to acquire ret...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
3d3e1225e59755683893b72ab74bb68a5a853c8d
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/3d3e1225e59755683893b72ab74bb68a5a853c8d/sdk/aws-smithy-client/src/retry.rs
201
260
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:7
sleep_impl: Option<Arc<dyn AsyncSleep>>, } #[cfg(test)] impl RetryHandler { fn retry_quota(&self) -> usize { *self.shared.quota_available.lock().unwrap() } } impl RetryHandler { /// Determine the correct response given `retry_kind` /// /// If a retry is specified, this function returns `(n...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
3d3e1225e59755683893b72ab74bb68a5a853c8d
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/3d3e1225e59755683893b72ab74bb68a5a853c8d/sdk/aws-smithy-client/src/retry.rs
241
300
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:8
let backoff = Duration::from_secs_f64(backoff).min(self.config.max_backoff); let next = RetryHandler { local: RequestLocalRetryState { attempts: self.local.attempts + 1, last_quota_usage: Some(quota_used), }, shared: self.shared.clone(), ...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
3d3e1225e59755683893b72ab74bb68a5a853c8d
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/3d3e1225e59755683893b72ab74bb68a5a853c8d/sdk/aws-smithy-client/src/retry.rs
281
340
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:9
let (next, dur) = match retry { RetryKind::Explicit(dur) => (self.clone(), dur), RetryKind::NotRetryable => return None, RetryKind::Error(err) => self.attempt_retry(Err(err))?, _ => return None, }; let sleep_future = sleep.sleep(dur); let fut = as...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
3d3e1225e59755683893b72ab74bb68a5a853c8d
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/3d3e1225e59755683893b72ab74bb68a5a853c8d/sdk/aws-smithy-client/src/retry.rs
321
380
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:10
fn must_be_send_sync<T: Send + Sync>() {} must_be_send_sync::<RetryHandler>() } #[test] fn eventual_success() { let policy = Standard::new(test_config()).new_request_policy(None); let (policy, dur) = policy .attempt_retry(Err(ErrorKind::ServerError)) .expect...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
3d3e1225e59755683893b72ab74bb68a5a853c8d
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/3d3e1225e59755683893b72ab74bb68a5a853c8d/sdk/aws-smithy-client/src/retry.rs
361
420
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:11
let no_retry = policy.attempt_retry(Err(ErrorKind::ServerError)); assert!(no_retry.is_none()); assert_eq!(policy.retry_quota(), 490); } #[test] fn no_quota() { let mut conf = test_config(); conf.initial_retry_tokens = 5; let policy = Standard::new(conf).new_request_p...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
3d3e1225e59755683893b72ab74bb68a5a853c8d
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/3d3e1225e59755683893b72ab74bb68a5a853c8d/sdk/aws-smithy-client/src/retry.rs
401
460
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:12
assert_eq!(dur, Duration::from_secs(4)); assert_eq!(policy.retry_quota(), 485); let (policy, dur) = policy .attempt_retry(Err(ErrorKind::ServerError)) .expect("should retry"); assert_eq!(dur, Duration::from_secs(8)); assert_eq!(policy.retry_quota(), 480); ...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
3d3e1225e59755683893b72ab74bb68a5a853c8d
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/3d3e1225e59755683893b72ab74bb68a5a853c8d/sdk/aws-smithy-client/src/retry.rs
441
489
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:3
pub fn with_max_attempts(mut self, max_attempts: u32) -> Self { self.max_attempts = max_attempts; self } } impl Default for Config { fn default() -> Self { Self { initial_retry_tokens: INITIAL_RETRY_TOKENS, retry_cost: RETRY_COST, no_retry_increment: ...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
fe1cfc31a925306b740e22a005fbf0ab6ec4fca7
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/fe1cfc31a925306b740e22a005fbf0ab6ec4fca7/sdk/aws-smithy-client/src/retry.rs
81
140
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:4
#[derive(Debug)] pub struct Standard { config: Config, shared_state: CrossRequestRetryState, } impl Standard { /// Construct a new standard retry policy from the given policy configuration. pub fn new(config: Config) -> Self { Self { shared_state: CrossRequestRetryState::new(config....
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
fe1cfc31a925306b740e22a005fbf0ab6ec4fca7
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/fe1cfc31a925306b740e22a005fbf0ab6ec4fca7/sdk/aws-smithy-client/src/retry.rs
121
180
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:5
#[derive(Clone, Debug)] struct RequestLocalRetryState { attempts: u32, last_quota_usage: Option<usize>, } impl Default for RequestLocalRetryState { fn default() -> Self { Self { // Starts at one to account for the initial request that failed and warranted a retry attempts: 1...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
fe1cfc31a925306b740e22a005fbf0ab6ec4fca7
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/fe1cfc31a925306b740e22a005fbf0ab6ec4fca7/sdk/aws-smithy-client/src/retry.rs
161
220
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:1
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ //! Retry support for aws-hyper //! //! The actual retry policy implementation will likely be replaced //! with the CRT implementation once the bindings exist. This //! implementation is intended to be ...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
5f4378d3e820cebbb6b7e7413d4592c7d5441559
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/5f4378d3e820cebbb6b7e7413d4592c7d5441559/sdk/aws-smithy-client/src/retry.rs
1
60
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:2
type Policy; /// Create a new policy mechanism instance. fn new_request_policy(&self) -> Self::Policy; } /// Retry Policy Configuration /// /// Without specific use cases, users should generally rely on the default values set by `[Config::default]`(Config::default).` /// /// Currently these fields are private...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
5f4378d3e820cebbb6b7e7413d4592c7d5441559
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/5f4378d3e820cebbb6b7e7413d4592c7d5441559/sdk/aws-smithy-client/src/retry.rs
41
100
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:3
self.max_attempts = max_attempts; self } } impl Default for Config { fn default() -> Self { Self { initial_retry_tokens: INITIAL_RETRY_TOKENS, retry_cost: RETRY_COST, no_retry_increment: 1, timeout_retry_cost: 10, max_attempts: MAX_ATT...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
5f4378d3e820cebbb6b7e7413d4592c7d5441559
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/5f4378d3e820cebbb6b7e7413d4592c7d5441559/sdk/aws-smithy-client/src/retry.rs
81
140
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:4
pub struct Standard { config: Config, shared_state: CrossRequestRetryState, } impl Standard { /// Construct a new standard retry policy from the given policy configuration. pub fn new(config: Config) -> Self { Self { shared_state: CrossRequestRetryState::new(config.initial_retry_tok...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
5f4378d3e820cebbb6b7e7413d4592c7d5441559
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/5f4378d3e820cebbb6b7e7413d4592c7d5441559/sdk/aws-smithy-client/src/retry.rs
121
180
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:5
struct RequestLocalRetryState { attempts: u32, last_quota_usage: Option<usize>, } impl Default for RequestLocalRetryState { fn default() -> Self { Self { // Starts at one to account for the initial request that failed and warranted a retry attempts: 1, last_quota...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
5f4378d3e820cebbb6b7e7413d4592c7d5441559
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/5f4378d3e820cebbb6b7e7413d4592c7d5441559/sdk/aws-smithy-client/src/retry.rs
161
220
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:6
} } fn quota_release(&self, value: Option<usize>, config: &Config) { let mut quota = self.quota_available.lock().unwrap(); *quota += value.unwrap_or(config.no_retry_increment); } /// Attempt to acquire retry quota for `ErrorKind` /// /// If quota is available, the amount of quo...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
5f4378d3e820cebbb6b7e7413d4592c7d5441559
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/5f4378d3e820cebbb6b7e7413d4592c7d5441559/sdk/aws-smithy-client/src/retry.rs
201
260
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:7
#[cfg(test)] impl RetryHandler { fn retry_quota(&self) -> usize { *self.shared.quota_available.lock().unwrap() } } impl RetryHandler { /// Determine the correct response given `retry_kind` /// /// If a retry is specified, this function returns `(next, backoff_duration)` /// If no retry ...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
5f4378d3e820cebbb6b7e7413d4592c7d5441559
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/5f4378d3e820cebbb6b7e7413d4592c7d5441559/sdk/aws-smithy-client/src/retry.rs
241
300
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:8
attempts: self.local.attempts + 1, last_quota_usage: Some(quota_used), }, shared: self.shared.clone(), config: self.config.clone(), }; Some((next, backoff)) } } impl<Handler, R, T, E> tower::retry::Policy<operation::Operation<Handler, R>, Sdk...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
5f4378d3e820cebbb6b7e7413d4592c7d5441559
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/5f4378d3e820cebbb6b7e7413d4592c7d5441559/sdk/aws-smithy-client/src/retry.rs
281
340
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:9
} fn clone_request(&self, req: &Operation<Handler, R>) -> Option<Operation<Handler, R>> { req.try_clone() } } fn check_send_sync<T: Send + Sync>(t: T) -> T { t } #[cfg(test)] mod test { use crate::retry::{Config, NewRequestPolicy, RetryHandler, Standard}; use aws_smithy_types::retry::Erro...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
5f4378d3e820cebbb6b7e7413d4592c7d5441559
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/5f4378d3e820cebbb6b7e7413d4592c7d5441559/sdk/aws-smithy-client/src/retry.rs
321
380
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:10
assert_eq!(dur, Duration::from_secs(2)); assert_eq!(policy.retry_quota(), 490); let no_retry = policy.attempt_retry(Ok(())); assert!(no_retry.is_none()); assert_eq!(policy.retry_quota(), 495); } #[test] fn no_more_attempts() { let policy = Standard::new(test_config(...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
5f4378d3e820cebbb6b7e7413d4592c7d5441559
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/5f4378d3e820cebbb6b7e7413d4592c7d5441559/sdk/aws-smithy-client/src/retry.rs
361
420
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:11
assert_eq!(policy.retry_quota(), 0); } #[test] fn backoff_timing() { let mut conf = test_config(); conf.max_attempts = 5; let policy = Standard::new(conf).new_request_policy(); let (policy, dur) = policy .attempt_retry(Err(ErrorKind::ServerError)) .ex...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
5f4378d3e820cebbb6b7e7413d4592c7d5441559
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/5f4378d3e820cebbb6b7e7413d4592c7d5441559/sdk/aws-smithy-client/src/retry.rs
401
460
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/retry.rs:12
conf.max_attempts = 5; conf.max_backoff = Duration::from_secs(3); let policy = Standard::new(conf).new_request_policy(); let (policy, dur) = policy .attempt_retry(Err(ErrorKind::ServerError)) .expect("should retry"); assert_eq!(dur, Duration::from_secs(1)); ...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/retry.rs
Apache-2.0
5f4378d3e820cebbb6b7e7413d4592c7d5441559
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/5f4378d3e820cebbb6b7e7413d4592c7d5441559/sdk/aws-smithy-client/src/retry.rs
441
472
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/static_tests.rs:1
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ //! This module provides types useful for static tests. #![allow(missing_docs, missing_debug_implementations)] use crate::{Builder, Operation, ParseHttpResponse, ProvideErrorKind}; use aws_smithy_http::o...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/static_tests.rs
Apache-2.0
531780ac84cd0504cdf789c503ad35d023a83c4d
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/531780ac84cd0504cdf789c503ad35d023a83c4d/sdk/aws-smithy-client/src/static_tests.rs
1
60
awslabs/aws-sdk-rust:sdk/aws-smithy-client/src/static_tests.rs:2
unreachable!("only used for static tests") } } pub type ValidTestOperation = Operation<TestOperation, DefaultResponseRetryClassifier>; // Statically check that a standard retry can actually be used to build a Client. #[allow(dead_code)] #[cfg(test)] fn sanity_retry() { Builder::new() .middleware(tower:...
rust
rust
rust-source
awslabs/aws-sdk-rust
sdk/aws-smithy-client/src/static_tests.rs
Apache-2.0
531780ac84cd0504cdf789c503ad35d023a83c4d
github
sdk
https://github.com/awslabs/aws-sdk-rust/blob/531780ac84cd0504cdf789c503ad35d023a83c4d/sdk/aws-smithy-client/src/static_tests.rs
41
100