Skip to main content

connect_or_start

Function connect_or_start 

Source
pub fn connect_or_start(
    scope_hash: Option<&str>,
) -> Result<DaemonClient, ClientError>
Expand description

Connect to the daemon, starting it first if it is not running.

  1. Attempt to connect.
  2. On failure, spawn running-process-daemon start as a detached process.
  3. Retry with exponential back-off: 50 ms, 100 ms, 200 ms, 400 ms.
  4. Return an error if the daemon cannot be reached after all retries.