Bases: object
Tuple of Characteristics introspectable enum member(s) that can be used to interogate how this driver works.
list of weak references to the object (if defined)
Request the creation of a group asynchronously.
Parameters: | group_id (str) – the id of the group to create |
---|---|
Returns: | None |
Return type: | CoordAsyncResult |
Delete a group asynchronously.
Parameters: | group_id (str) – the id of the group to leave |
---|---|
Returns: | Result |
Return type: | CoordAsyncResult |
Return the list composed by all groups ids asynchronously.
Returns: | the list of all created group ids |
---|---|
Return type: | CoordAsyncResult |
Return the leader for a group.
Parameters: | group_id – the id of the group: |
---|---|
Returns: | the leader |
Return type: | CoordAsyncResult |
Return a distributed lock.
This is a exclusive lock, a second call to acquire() will block or return False.
Parameters: | name – The lock name that is used to identify it across all nodes. |
---|
Return the capabilities of a member asynchronously.
Parameters: |
|
---|---|
Returns: | capabilities of a member |
Return type: | CoordAsyncResult |
Return the statistics and capabilities of a member asynchronously.
Parameters: |
|
---|---|
Returns: | capabilities and statistics of a member |
Return type: | CoordAsyncResult |
Return the list of all members ids of the specified group.
Returns: | list of all created group ids |
---|---|
Return type: | CoordAsyncResult |
Update member status to indicate it is still alive.
Method to run once in a while to be sure that the member is not dead and is still an active member of a group.
Returns: | The number of seconds to wait before sending a new heartbeat. |
---|
Join a group and establish group membership asynchronously.
Parameters: |
|
---|---|
Returns: | None |
Return type: | CoordAsyncResult |
Leave a group asynchronously.
Parameters: | group_id (str) – the id of the group to leave |
---|---|
Returns: | None |
Return type: | CoordAsyncResult |
Usage requirement that if true requires that the heartbeat() be called periodically (at a given rate) to avoid locks, sessions and other from being automatically closed/discarded by the coordinators backing store.
Try to leader elect this coordinator & activate hooks on success.
Run the watchers callback.
This may also activate run_elect_coordinator() (depending on driver implementation).
Stand down as the group leader if we are.
Parameters: | group_id – The group where we don’t want to be a leader anymore |
---|
Start the service engine.
If needed, the establishment of a connection to the servers is initiated.
Stop the service engine.
If needed, the connection to servers is closed and the client will disappear from all joined groups.
Call a function when member gets elected as leader.
The callback functions will be executed when run_watchers is called.
Parameters: |
|
---|
Stop executing a function when a group_id sees a new member joined.
Parameters: |
|
---|
Stop executing a function when a group_id sees a new member leaving.
Parameters: |
|
---|
Update member capabilities in the specified group.
Parameters: |
|
---|---|
Returns: | None |
Return type: | CoordAsyncResult |
Call a function when member gets elected as leader.
The callback functions will be executed when run_watchers is called.
Parameters: |
|
---|
Bases: exceptions.Exception
Exception raised when an internal error occurs.
Raised for instance in case of server internal error.
Variables: | cause – the cause of the exception being raised, when not none this will itself be an exception instance, this is useful for creating a chain of exceptions for versions of python where this is not yet implemented/supported natively. |
---|
list of weak references to the object (if defined)
Bases: tooz.coordination.ToozError
Exception raised when the client cannot connect to the server.
Bases: tooz.coordination.ToozError
Exception raised when an operation times out.
Bases: tooz.coordination.ToozError
Exception raised when the caller request an nonexistent group.
Bases: tooz.coordination.ToozError
Exception raised trying to create an already existing group.
Bases: tooz.coordination.ToozError
Exception raised trying to join a group already joined.
Bases: tooz.coordination.ToozError
Exception raised trying to access a member not in a group.
Bases: tooz.coordination.ToozError
Exception raised when the caller try to delete a group with members.
Helper to raise + chain exceptions (when able) and associate a cause.
For internal usage only.
NOTE(harlowja): Since in py3.x exceptions can be chained (due to PEP 3134) we should try to raise the desired exception with the given cause.
Parameters: |
|
---|