-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
`backoff` hasn't been updated in years, and `backon` supports `wasm32-unknown-unknown`. Most of the `events_watcher` module builds on WASM now.
- Loading branch information
1 parent
f723e74
commit a1468cf
Showing
11 changed files
with
99 additions
and
113 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
use core::time::Duration; | ||
|
||
/// A backoff policy which always returns a constant duration, with no maximum retry count. | ||
#[derive(Debug, Clone, Copy)] | ||
pub struct UnboundedConstantBuilder { | ||
interval: Duration, | ||
} | ||
|
||
impl UnboundedConstantBuilder { | ||
/// Creates a new unbounded Constant backoff | ||
/// | ||
/// * `interval` is the duration to wait between retries. | ||
#[must_use] | ||
#[allow(dead_code)] | ||
pub fn new(interval: Duration) -> Self { | ||
Self { interval } | ||
} | ||
} | ||
|
||
impl backon::BackoffBuilder for UnboundedConstantBuilder { | ||
type Backoff = UnboundedConstantBuilder; | ||
|
||
fn build(self) -> Self::Backoff { | ||
self | ||
} | ||
} | ||
|
||
impl Iterator for UnboundedConstantBuilder { | ||
type Item = Duration; | ||
|
||
fn next(&mut self) -> Option<Self::Item> { | ||
Some(self.interval) | ||
} | ||
} |
Oops, something went wrong.