connect_with_retry

Function connect_with_retry 

Source
pub async fn connect_with_retry(url: &str) -> Result<Client, Error>
Expand description

Attempt to connect to NATS with retries

Useful when starting an embedded server that needs time to initialize.

§Arguments

  • url - NATS server URL

§Returns

Connection after successful connect, or last error after 10 retries