Struct fruently::retry_conf::RetryConf
[−]
[src]
pub struct RetryConf { /* fields omitted */ }
You can calculate retrying interval as the following equation:
retry_interval = exp ** (multiplier + retry_counts)
see: https://github.com/jimmycuadra/retry/blob/v0.4.0/src/lib.rs#L142-L143
You can estimate to caluculate with concrete values like:
retry_counts
: 10, e ^ (5 + 10)/1000.0/60.0/60.0 = 0.908060381242253, about 0.9 hourretry_counts
: 11, e ^ (5 + 11)/1000.0/60.0/60.0 = 2.4683640334744092, about 2.5 hoursretry_counts
: 12, e ^ (5 + 12)/1000.0/60.0/60.0 = 6.709709098215361, about 6.7 hours
where multiplier = 5, e is exponential function.
If you specify store_file_path
, fruently
tries to store record(s)
when failing to send into Fluent protocol implemented server.
Default values
- multiplier:
5_f64
- max: 10
store_file_path
: None
Methods
impl RetryConf
[src]
pub fn new() -> RetryConf
[src]
pub fn max(self, max: u64) -> RetryConf
[src]
pub fn multiplier(self, multiplier: f64) -> RetryConf
[src]
pub fn store_file(self, path: PathBuf) -> RetryConf
[src]
pub fn need_to_store(self) -> bool
[src]
pub fn store_path(self) -> Option<PathBuf>
[src]
pub fn build(self) -> (u64, f64)
[src]
Trait Implementations
impl Debug for RetryConf
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Clone for RetryConf
[src]
fn clone(&self) -> RetryConf
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq for RetryConf
[src]
fn eq(&self, __arg_0: &RetryConf) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &RetryConf) -> bool
[src]
This method tests for !=
.