Module Versioned_rpc.Expert

val connection : t -> [ `Close_started | `Ok of conn ] Async_kernel.Deferred.t

Provides direct access to the connection state. Compared to calling connected from the non-Expert API, this:

  • Avoids attaching a new handler with each call.
  • Becomes determined if the persistent connection is closed (rather than never doing so).
  • Doesn't attempt to prevent a race condition by checking Conn.is_closed conn and retrying if false.

This makes it more suitable for use in a loop calling Deferred.choose or similar.

val time_source : t -> Async_kernel.Time_source.t

The time source that the connection uses for retry delays