enum

NATS::Client::State

Inherits Enum / Comparable / Value / Object

The current state of the client's connection

Constants

Connecting = 0

The connection is currently awaiting a completed NATS connection. We could be awaiting TCP, TLS, NATS protocol handshake, synchronization, etc. Ideally, a client doesn't spend more than a few milliseconds in this state.

Connected = 1

A successful NATS connection has been made.

Disconnected = 2

The client has been disconnected and is either currently executing its disconnect handler or is waiting on the reconnect backoff period.

Reconnecting = 3

The disconnect handler has been invoked, the backoff period has elapsed and the client is currenty attempting to reconnect to the NATS server.

Closed = 4

The client has been explicitly closed with NATS::Client#close.

Instance methods

closed?

Returns true if this enum value equals Closed

Source
connected?

Returns true if this enum value equals Connected

Source
connecting?

Returns true if this enum value equals Connecting

Source
disconnected?

Returns true if this enum value equals Disconnected

Source
reconnecting?

Returns true if this enum value equals Reconnecting

Source