-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add timeout when waiting for processing
- Loading branch information
1 parent
49cce67
commit 651388b
Showing
5 changed files
with
53 additions
and
5 deletions.
There are no files selected for viewing
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,18 @@ | ||
use derive_deref::Deref; | ||
use std::time::Duration; | ||
|
||
/// A duration with 90 second default | ||
#[derive(Debug, Deref, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] | ||
pub struct Timeout(Duration); | ||
|
||
impl Default for Timeout { | ||
fn default() -> Self { | ||
Self(Duration::from_secs(90)) | ||
} | ||
} | ||
|
||
impl From<Duration> for Timeout { | ||
fn from(value: Duration) -> Self { | ||
Self(value) | ||
} | ||
} |