You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/06/13 02:00:08 UTC

[GitHub] [shardingsphere-elasticjob] TeslaCN commented on a diff in pull request #2092: Each job has its own listener event notify thread instead of the only one curator thread

TeslaCN commented on code in PR #2092:
URL: https://github.com/apache/shardingsphere-elasticjob/pull/2092#discussion_r895273229


##########
elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenter.java:
##########
@@ -408,20 +409,28 @@ public void executeInLeader(final String key, final LeaderExecutionCallback call
     }
     
     @Override
-    public void watch(final String key, final DataChangedEventListener listener) {
+    public void watch(final String key, final DataChangedEventListener listener, final Executor executor) {
         CuratorCache cache = caches.get(key + "/");
-        cache.listenable().addListener((curatorType, oldData, newData) -> {
-            if (null == newData && null == oldData) {
-                return;
+        CuratorCacheListener cacheListener = new CuratorCacheListener() {

Review Comment:
   Why change this to anonymous class?



-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org