jurmous / etcd4j

Java / Netty client for etcd, the highly-available key value store for shared configuration and service discovery.
Apache License 2.0
267 stars 83 forks source link

Consider making waitForPromiseSuccess, since response is not always needed. #158

Closed artheus closed 7 years ago

artheus commented 7 years ago

I am currently working with your client. It took me some time to actually understand that .send().get() is what is needed to get changes actually commited to etcd, when using AutoClosable with a try clause.

I do not really care about the etcd response more than that it is a success. Therefore I would like to be able to use the waitForPromiseSuccess() method outside of the client object. This would help to make the code easier to understand. Actually writing .send().waitForPromiseSuccess() would have helped me to understand this faster.

Sorry if this is usually obvious to Java developers who are used to Async requests.

lburgazzoli commented 7 years ago

Maybe I can add sendAndGet but I cannot commit to an ETA as I'm quite busy and most of the effort related to etcd are on the official java client for Etcd v3 (coreos/jetcd)

artheus commented 7 years ago

When further considering what I am asking for this seems like a request which is for a highly unusual edge case. Therefore, I will close this Issue.

Using .send().get(), and disregarding the response data will work just as well. I was after blocking the thread, but disregarding the response (if successful) to save RAM. But I realise that it would mean a major change for a minor use-case.