eolivelli commented on code in PR #514:
URL: https://github.com/apache/curator/pull/514#discussion_r3630809513


##########
curator-framework/src/main/java/org/apache/curator/framework/CuratorFrameworkFactory.java:
##########
@@ -519,6 +521,19 @@ public Builder runSafeService(Executor runSafeService) {
             return this;
         }
 
+        /**
+         * By default, watches are run sequentially.
+         * If an executor is provided here, then all watch calls will be run 
asynchronously via this executor.
+         * This executor service will be closed when the CuratorFramework is 
closed.
+         *
+         * @param asyncWatchService executorService to use for all watch calls
+         * @return this
+         */
+        public Builder asyncWatchService(ExecutorService asyncWatchService) {

Review Comment:
   I would probably name this method "executeWatchesAsync"



##########
curator-framework/src/main/java/org/apache/curator/framework/CuratorFrameworkFactory.java:
##########
@@ -519,6 +521,19 @@ public Builder runSafeService(Executor runSafeService) {
             return this;
         }
 
+        /**
+         * By default, watches are run sequentially.
+         * If an executor is provided here, then all watch calls will be run 
asynchronously via this executor.
+         * This executor service will be closed when the CuratorFramework is 
closed.
+         *
+         * @param asyncWatchService executorService to use for all watch calls
+         * @return this
+         */
+        public Builder asyncWatchService(ExecutorService asyncWatchService) {

Review Comment:
   is there any additional constraint on the ExecutorService ?
   can operations be executed in any order ?
   
   what happens in case of rejected execution ?
   what happens if the watcher code "throws" ? should the ExecutorService be 
resilient ?
   
   



-- 
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]

Reply via email to