This package allows you to initialize a member group in zookeeper, monitor its members, and register one or more members.
This is useful for instance to manage the nodes when implementing consistent hashing.
const ZKGroupMembership = ZKGroupMembership;const Zookeeper = ;console;const client = Zookeeper;client;const group= client '/groups/sharding_example_cluster'timeout: 10000 //Optional timeout for registering, getting members, getting data etcsetupTimeout: 10000 //Optional timeout for the setup call.;group//Register a member with a generated id and no associated data;
Running the example
Please look here
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality, lint and test your code.
To run lint and tests:npm testnpm run lint