struct

MQTT::Reconnect

Inherits Struct / Value / Object

Controls how a client re-establishes a connection that dropped unexpectedly. Delays back off exponentially and are capped at max_delay.

Constructors

new(initial_delay : Time::Span = 1.second, max_delay : Time::Span = 30.seconds, max_attempts : Int32 | Nil = nil)
Source

Instance methods

delay_for(attempt : Int32) : Time::Span

attempt is 1 based

Source
give_up?(attempt : Int32) : Bool
Source
initial_delay
Source
max_attempts

nil retries forever

Source
max_delay
Source