curator-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sznajder ForMailingList <bs4mailingl...@gmail.com>
Subject Listener - checkExists() Vs. getchildren()
Date Wed, 20 Nov 2013 13:35:25 GMT
Hi

I would like to monitoring the number of items in a queue.
For that, in the queue producer, I defined a listener

        CuratorListener listener = new CuratorListener() {
            @Override
            public void eventReceived(final CuratorFramework framework_,
                    CuratorEvent event) throws Exception {
                                Stat stat =
framework_.checkExists().watched().forPath(Utils.CRAWL_QUEUE_PATH);
                System.out.println("!! = " + stat.getNumChildren());
            }
        };

        framework.getCuratorListenable().addListener(listener);





However, this listener does not catch any event!

If I change the event watched to be
            List<String> children =
framework.getChildren().watched().forPath(Utils.CRAWL_QUEUE_PATH);


It matches all the event on the queue.


Do you have any hint?

Best regards
Benjamin

Mime
View raw message