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 03:35:57 UTC

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

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


##########
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?
   
   I'm not familiar with lamda expression,  so I use anonymous class to resuse the code. I can change it back to lamda expression.



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