Skip to content

Commit

Permalink
Doc comment
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidSouther committed Feb 8, 2024
1 parent afa240a commit 910d0a9
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions rustv1/test-utils/src/waiter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,24 +93,22 @@ impl WaiterBuilder {
}
}

/// Create an async block to repeat a request until the result of the test is true.
/// The test will work on a completed request - that is, retries, errors, etc will happen before
/// the test is called. The response is considered done and successful by the SDK.
/// For example, this can be used to wait for a long-running operation to change to `status: Done|Cancelled`.
///
/// - $waiter is a Waiter used to sleep between attempts, with a maximum timeout.
/// - $req is an expr that evaluates to an API call that can be `.clone().send().await`ed.
/// - $test is an expr that should be an Fn which gets passed the successful response of the
#[macro_export]
macro_rules! wait_on {
// Create an async block to repeat a request until the result of the test is true.
// Uses the default Waiter (500ms interval, 25m timeout).
(
$req: expr,
$test: expr
) => {
wait_on!($crate::waiter::Waiter::default(), $req, $test)
};
// Create an async block to repeat a request until the result of the test is true.
// The test will work on a completed request - that is, retries, errors, etc will happen before
// the test is called. The response is considered done and successful by the SDK.
// For example, this can be used to wait for a long-running operation to change to `status: Done|Cancelled`.
//
// - $waiter is a Waiter used to sleep between attempts, with a maximum timeout.
// - $req is an expr that evaluates to an API call that can be `.clone().send().await`ed.
// - $test is an expr that should be an Fn which gets passed the successful response of the
(
$waiter: expr,
$req: expr,
Expand Down

0 comments on commit 910d0a9

Please sign in to comment.