Connection

Wraps the connection information and logic.

The Connection instance wraps the host information (hostname, port, attributes, etc), as well as the "session" (a transport client object, such as a {elasticsearch.transport.http.vibe} instance).

It provides methods to construct and properly encode the URLs and paths for passing them to the transport client object.

It provides methods to handle connection lifecycle (dead, alive, healthy).

Constructors

this
this(Host host, Transport connection, int resurrectTimeout)
Undocumented in source.

Members

Functions

fullPath
string fullPath(string path, ESParams params)
Undocumented in source. Be warned that the author may not have intended to support it.
fullURL
string fullURL(string path, ESParams params)

Returns the complete endpoint URL with host, port, path and serialized parameters.

makeAlive
Connection makeAlive()

Marks this connection as alive, ie. it is eligible to be returned from the pool by the selector.

makeDead
Connection makeDead()

Marks this connection as dead, incrementing the failures counter and storing the current time as dead_since.

makeHealthy
Connection makeHealthy()

Marks this connection as healthy, ie. a request has been successfully performed with it.

resurrect
Connection resurrect()

Marks this connection as alive, if the required timeout has passed.

toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

alive
bool alive [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
dead
bool dead [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
deadSince
SysTime deadSince [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
failures
int failures [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
host
Host host [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
resurrectTimeout
int resurrectTimeout [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
resurrectable
bool resurrectable [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

_connection
Transport _connection;
Undocumented in source.
_dead
bool _dead;
Undocumented in source.
_deadSince
SysTime _deadSince;
Undocumented in source.
_failures
int _failures;
Undocumented in source.
_host
Host _host;
Undocumented in source.
_resurrectTimeout
int _resurrectTimeout;
Undocumented in source.

Meta