yfinkelstein/node-zookeeper — pull request #63 by pooyasencha (2012-07-27 21:34:01+00:00)
Title: Node 0.8 timing fixes

Here is a fix for timing issues of node-zookeeper in node 0.8.x.

Node 0.8 deprecated libev and replaced it with libuv. To keep old modules compatible they created an emulated wrapper named [ev-mul.h](https://github.com/joyent/node/blob/master/src/ev-emul.h).
Although that file even includes hacks specific to node-zookeeper (see [__ev_timer_again](https://github.com/joyent/node/blob/master/src/ev-emul.h#L210)), it still has some timing issues. node-zookeeper expects to have a repeating timer but be able to change it's delay on every iteration but that is not possible in libuv, thus I updated the module to use a single run timer but reset it everytime. The change should only affect node 0.8.

There are still warnings shown about deprecated libev_* calls but fixing those in now just a matter of merging ev_emul.h's logic into node-zk.c which can be done at a later point.

Please consider merging this into upstream and publishing to npmjs.

Thanks