kezhuw opened a new pull request, #2168:
URL: https://github.com/apache/zookeeper/pull/2168
Currently, `zookeeper.request.timeout` is only respected in synchronous api.
I think there are should be no much differences between following two.
```java
String createdPath = zk.create("/path", data, Ids.OPEN_ACL_UNSAFE,
CreateMode.PERSISTENT);
```
```java
CompletableFuture<String> future = new CompletableFuture<>();
zk.create("/path", data, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT, (rc,
path, ctx, name) -> {
if (rc == 0) {
future.complete(name);
} else {
future.completeExceptionally(KeeperException.create(KeeperException.Code.get(rc),
path));
}
}, null);
String createdPath = future.join();
```
After this pr, we are able to unify synchronous api through calls to
asynchronous api as [review comments][review-comments] pointed out if we feel
there are too much identical code between synchronous and asynchronous api.
[review-comments]:
https://github.com/apache/zookeeper/pull/2068#discussion_r1337763619
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]