jira-importer commented on issue #535: URL: https://github.com/apache/curator/issues/535#issuecomment-2604692486
<i><a href="https://issues.apache.org/jira/secure/ViewProfile.jspa?name=cheddar">cheddar</a>:</i> <p>I finally had a chance to look at code and not just talk in high level abstractiness, but I don't see why we cannot have an unregister method now (and I wonder if, without that, we aren't just re-implementing the watcher mechanism that ZK already has).</p> <p>It seems like we should be able to adjust DispatchingWatcher to have an unregister() method on it. We can then put methods for registering and returning the watcher directly on the CuratorFramework along with methods to unregister the watcher. Simple object equality should be sufficient for removing the watcher from the Set in DispatchingWatcher. The big concern here is race conditions around a watch getting fired and it being unregistered concurrently. I think this is a fine concern to bubble up to the users, they have to write their Watchers/close methods with the understanding that even if they are currently unregistering the watcher, it could still get called.</p> <p>Then all of the recipes that end up calling the builders with a "usingWatcher" will have the ability to remove their watchers from the base CuratorFramework when their respective close() methods are called.</p> <p>Hopefully that makes sense?</p> -- 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: dev-unsubscr...@curator.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org