-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ZOOKEEPER-4749: Respect zookeeper.request.timeout also for asynchrono…
…us api 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]: #2068 (comment)
- Loading branch information
Showing
6 changed files
with
197 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.