enum NATS::Client::State

Overview

The current state of the client's connection

Defined in:

nats.cr

Enum Members

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 Method Summary

Instance Method Detail

def closed? #

[View source]
def connected? #

[View source]
def connecting? #

[View source]
def disconnected? #

[View source]
def reconnecting? #

[View source]