pub(crate) async fn try_request<T: 'static>(
    client: Client<T, Body>,
    request: (Request<Body>, Option<Vec<u8>>),
) -> Result<IpcMessage, RequestError>
where
    T: hyper::client::connect::Connect + Clone + Sync + Send,
{
    let retry_strategy = FibonacciBackoff::from_millis(10)
        .map(jitter)
        .take(REQ_RETRY_LIMIT);

    RetryIf::spawn(
        retry_strategy,
        || dispatch_request(&client, &request),
        is_retryable_error,
    )
    .await
}
/// Tries to request provided resource. This function retries requests if it makes sense and ultimatively returns the parsed [`IpcMessage`] if it succeeds.
///
/// As the requests are consumed, this function internally clones a provided request, and internally calls [`dispatch_request`] which then sends the request and handles the parsing of the response.
///
/// This function should be used in combination with the requests provided in the [`super::requests`] module like follows:
/// ```rust
/// retry::try_request(client, requests::post_test_results(TestResults {}))
/// .await
/// .unwrap();
/// ```
///
/// # Unwrapping
/// As this function already internally retries failed requests the ultimative result should be unwrapped, as the underlying error is likely not recoverable by the application at runtime.
Tries to request provided resource. This function retries requests if it makes sense and ultimatively returns the parsed [`IpcMessage`] if it succeeds.
As the requests are consumed, this function internally clones a provided request, and internally calls [`dispatch_request`] which then sends the request and handles the parsing of the response.


Tries to request provided resource . This function retries requests if it makes sense and ultimatively returns the parsed [ ` IpcMessage ` ] if it succeeds . As the requests are consumed this function internally clones a provided request and internally calls [ ` dispatch_request ` ] which then sends the request and handles the parsing of the response .
pub(crate) async fn try_request<T: 'static>(
    client: Client<T, Body>,
    request: (Request<Body>, Option<Vec<u8>>),
) -> Result<IpcMessage, RequestError>
where
    T: hyper::client::connect::Connect + Clone + Sync + Send,
{
    let retry_strategy = FibonacciBackoff::from_millis(10)
        .map(jitter)
        .take(REQ_RETRY_LIMIT);
    RetryIf::spawn(
        retry_strategy,
        || dispatch_request(&client, &request),
        is_retryable_error,
    )
    .await
}
pub ( crate ) async fn try_request < T : ' static > ( client : Client < T , Body > , request : ( Request < Body > , Option < Vec < u8 > > ) , ) -> Result < IpcMessage , RequestError > where T : hyper :: client :: connect :: Connect + Clone + Sync + Send , { let retry_strategy = FibonacciBackoff :: from_millis ( 10 ) . map ( jitter ) . take ( REQ_RETRY_LIMIT ) ; RetryIf :: spawn ( retry_strategy , | | dispatch_request ( & client , & request ) , is_retryable_error , ) . await }
Tries to request provided resource.
Tries to request provided resource .
client
Client<T, Body>
request
(Request<Body>, Option<Vec<u8>>)
unwrapping
As this function already internally retries failed requests the ultimative result should be unwrapped, as the underlying error is likely not recoverable by the application at runtime.
As this function already internally retries failed requests the ultimative result should be unwrapped as the underlying error is likely not recoverable by the application at runtime .