Closed guohaoyun closed 2 years ago
Hi @guohaoyun thank you for asking about these two very similar functions.
I would recommend to use the init function together with listeners, as described in the readme: https://github.com/yfinkelstein/node-zookeeper#example-create-a-client
The connect function calls the init function internally, plus the connect handling. But I see that one as a legacy function. I decided to keep it to not cause any breaking features for existing users.
Hi @guohaoyun thank you for asking about these two very similar functions.
I would recommend to use the init function together with listeners, as described in the readme: https://github.com/yfinkelstein/node-zookeeper#example-create-a-client
The connect function calls the init function internally, plus the connect handling. But I see that one as a legacy function. I decided to keep it to not cause any breaking features for existing users.
Thanks for replying!
Or When to use connect() and when to use init() ?