Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow de-registration of listeners on node deletion #15

Open
ezbz opened this issue Aug 3, 2011 · 0 comments
Open

Allow de-registration of listeners on node deletion #15

ezbz opened this issue Aug 3, 2011 · 0 comments

Comments

@ezbz
Copy link

ezbz commented Aug 3, 2011

Currently when watching ephemeral nodes the consuming code has to "manually" check for and remove listeners for dead ephemeral nodes. Since ZkClient doesn't deliver the node deletion event (EventType.NodeDeleted) explicitly but rather encapsulates it in a "data change" event this forces the consuming code to execute another read with zookeeper to find out that the node was indeed deleted.

When watching for ephemeral sequential nodes (e.g., leader election scenario) if the client doesn't remove the listener they continue to build up in the list forever.

I think it should be possible to provide a flag on listener registration to remove the listener when the watched node gets deleted. Another option would be to send back the underlying EventType to a data changed listener and still require the client code to remove the listener on it's own.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant