Using Watchers Callbacks
Learn about using watchers callbacks.
We'll cover the following...
When a member joins or leaves a group, applications usually want to run an action. There is a mechanism provided by Tooz to help with the named watchers. It works by caching a list of the members and running the specified callback functions each time a member joins or leaves the group.
To use those callbacks, Tooz provides the watch_join_group
and watch_leave_ group
methods to register functions to call on join or leave events. If you ever need
to un-register a callback, unwatch_join_group
and unwatch_leave_group
provide this functionality.
Once the callback functions are registered, they ...