AsyncHttpClient handlers used to handle requests and return etcd responses asynchronously.
For a given HTTP request, etcd most often returns a response containing a JSON array in its body (although, sometimes it may return an empty body).
A response may also contain HTTP headers with the HTTP status code for the response and some information of the etcd cluster (mostly indexes captured as instances of EtcdIndex).
AsyncHttpClient offers support for handling HTTP requests with customized handlers.
Each handler formats a type of response returned by etcd by parsing the JSON array returned in the response and retrieving the pertinent information in the response's headers.
The parsing is done using JSON4S extract method and case classes defined in package model.
The information retrieved from the response's headers is passed along with the body to appropriate case classes in the same package.
Http requests to etcd may return and error response or a success response.
Error responses usually contain useful information on what went wrong, while success responses return the status of etcd after the request is performed.
Handlers appropriately adapted to deal with both situations.
Handlers
AsyncHttpClient handlers used to handle requests and return etcd responses asynchronously.
For a given HTTP request, etcd most often returns a response containing a JSON array in its body (although, sometimes it may return an empty body). A response may also contain HTTP headers with the HTTP status code for the response and some information of the etcd cluster (mostly indexes captured as instances of EtcdIndex). AsyncHttpClient offers support for handling HTTP requests with customized handlers. Each handler formats a type of response returned by etcd by parsing the JSON array returned in the response and retrieving the pertinent information in the response's headers. The parsing is done using JSON4S extract method and case classes defined in package model. The information retrieved from the response's headers is passed along with the body to appropriate case classes in the same package.
Http requests to etcd may return and error response or a success response. Error responses usually contain useful information on what went wrong, while success responses return the status of etcd after the request is performed. Handlers appropriately adapted to deal with both situations.