zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grigory Dzhavadyan <grigory.javad...@gmail.com>
Subject Re: Generating Events With Incorrect types
Date Mon, 11 Jun 2012 17:27:37 GMT

It appears that I have mixed up the order of "event type" and
"connection state" arguments in the handler function. Both are
integers, so the compiler did not say anything. A hard-to-notice error
:-). Maybe it would make sense to turn those into enums? At least the
C++ compiler would complain, I guess.

On Fri, Jun 8, 2012 at 3:51 PM, Michi Mutsuzaki <michi@cs.stanford.edu> wrote:
> Hi Grigory,
> Yes, you should get ZOO_CREATED_EVENT. Could you post a short program
> that reproduces the issue?
> Thanks!
> --Michi
> On Fri, Jun 8, 2012 at 2:15 PM, Grigory Dzhavadyan
> <grigory.javadyan@gmail.com> wrote:
>> Hello,
>> I'm using the Zookeeper C API to set a watch on a non-existent node
>> using the `zoo_wexists' function.
>> When I create that node, I'm expecting the event handler to be called
>> with `type' equal to `ZOO_CREATED_EVENT'. However, instead it's being
>> called with type equal to `ZOO_CHANGED_EVENT'. Why is that so and what
>> should I do to receive the correct type in the event handler?

View raw message