You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@curator.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/02/10 21:56:41 UTC

[jira] [Commented] (CURATOR-386) Allow listener to be passed in to PersistentNode to notify for node creation events

    [ https://issues.apache.org/jira/browse/CURATOR-386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15861892#comment-15861892 ] 

ASF GitHub Bot commented on CURATOR-386:
----------------------------------------

GitHub user akira opened a pull request:

    https://github.com/apache/curator/pull/198

    [CURATOR-386] Allow listener to be passed in to PersistentNode

    This provides ability to hook into events from PersistentNode when a
    node gets created.  PersistentNode would then notify any registered listeners that the 
    node was created, along with the path created (useful when protection is used). 

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/akira/curator CURATOR-386

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/curator/pull/198.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #198
    
----
commit 8bb0cc86343eca7e2b38bccda39ab28d6c19113c
Author: Alex Kira <ak...@uber.com>
Date:   2017-02-10T21:52:59Z

    [CURATOR-386] Allow listener to be passed in to PersistentNode
    
    This provides ability to hook into events from PersistentNode when a
    node gets created.

----


> Allow listener to be passed in to PersistentNode to notify for node creation events
> -----------------------------------------------------------------------------------
>
>                 Key: CURATOR-386
>                 URL: https://issues.apache.org/jira/browse/CURATOR-386
>             Project: Apache Curator
>          Issue Type: Improvement
>          Components: Recipes
>    Affects Versions: 3.2.1
>            Reporter: Alex Kira
>            Priority: Minor
>
> I think it would be useful to allow a listener to be passed in to the PersistentNode that would notify when the new node is created. This is useful as some cases such as disconnect / reconnect or when an ephemeral node is deleted and recreated by PersistentNode. In this case, I would like to be able to listen to these even so I can do something like issue a watch on the node.  
> For example:
> ```
> public interface PersistentNodeListener {
>     /**
>      * Called on a persistentNode event when node is created
>      *
>      * @param path Path of the znode
>      * @throws Exception errors
>      */
>     void nodeCreated(String path) throws Exception;
> }
> ```
> I have a code change implementing this and can issue a pull request for this.  



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)