elastisch icon indicating copy to clipboard operation
elastisch copied to clipboard

Async version of the REST API

Open sachinpkale opened this issue 7 years ago • 5 comments

As Rest APIs use clj-http internally, can we add async? functionality supported by clj-http? Reference: https://github.com/dakrone/clj-http#async-http-request

sachinpkale avatar Aug 16 '17 12:08 sachinpkale

Are results returned still responses or are they futures? clj-http docs do not make this clear (or I don't know where to look)

michaelklishin avatar Aug 16 '17 12:08 michaelklishin

Result returned is a future (It will contain response headers once API call is complete). Actual response will be provided to the first callback and error (if any) will be provided in the second callback.

The current flow is blocking and will become bottle-neck in any non-blocking flow which also uses elastisch

sachinpkale avatar Aug 16 '17 12:08 sachinpkale

Then it's a new API and not an unsupported option. Unless someone is willing to put in the work, I doubt it will happen any time soon. ElasticSearch 5.0 support is already a significant enough milestone we are behind on.

michaelklishin avatar Aug 16 '17 12:08 michaelklishin

@michaelklishin Are you open to pull requests? I can help with this change.

sachinpkale avatar Aug 16 '17 14:08 sachinpkale

@sachinpkale I am but let's start with a small spike to see what it would look like. In fact, I'd only start after we release a version that supports ES 5.0, so that's the best way to contribute at the moment. There's only one doco issue left before 3.0 can ship.

michaelklishin avatar Aug 16 '17 14:08 michaelklishin