Module Persistent_connection_kernel.Connect_context

type t

Context passed to connect in create_with_connect_context that provides information about the connection state and allows the callback to abort the persistent connection.

val abort : t -> Core.Error.t -> unit

abort t error causes the persistent connection to stop retrying and stop reconnecting.

connected_or_failed_to_connect will return Error error. Calling abort multiple times is safe; subsequent calls are ignored.

val consecutive_unsuccessful_attempts_so_far : t -> int

Returns the number of consecutive unsuccessful connection attempts so far, not including the current attempt. Returns 0 on the first attempt, 1 on the second attempt after the first failed, etc.

module Private : sig ... end