| 1 |
.. _client_module: |
| 2 |
|
| 3 |
:mod:`kazoo.client` |
| 4 |
---------------------------- |
| 5 |
|
| 6 |
.. automodule:: kazoo.client |
| 7 |
|
| 8 |
Public API |
| 9 |
++++++++++ |
| 10 |
|
| 11 |
.. autoclass:: KazooClient() |
| 12 |
:members: |
| 13 |
:member-order: bysource |
| 14 |
|
| 15 |
.. automethod:: __init__ |
| 16 |
|
| 17 |
.. attribute:: handler |
| 18 |
|
| 19 |
The :class:`~kazoo.interfaces.IHandler` strategy used by this |
| 20 |
client. Gives access to appropriate synchronization objects. |
| 21 |
|
| 22 |
.. method:: retry(func, *args, **kwargs) |
| 23 |
|
| 24 |
Runs the given function with the provided arguments, retrying if it |
| 25 |
fails because the ZooKeeper connection is lost, |
| 26 |
see :ref:`retrying_commands`. |
| 27 |
|
| 28 |
.. attribute:: state |
| 29 |
|
| 30 |
A :class:`~kazoo.protocol.states.KazooState` attribute indicating |
| 31 |
the current higher-level connection state. |
| 32 |
|
| 33 |
.. note:: |
| 34 |
|
| 35 |
Up to version 2.6.1, requests could only be submitted |
| 36 |
in the CONNECTED state. Requests submitted while |
| 37 |
SUSPENDED would immediately raise a |
| 38 |
:exc:`~kazoo.exceptions.SessionExpiredError`. This |
| 39 |
was problematic, as sessions are usually recovered on |
| 40 |
reconnect. |
| 41 |
|
| 42 |
Kazoo now simply queues requests submitted in the |
| 43 |
SUSPENDED state, expecting a recovery. This matches |
| 44 |
the behavior of the Java and C clients. |
| 45 |
|
| 46 |
Requests submitted in a LOST state still fail |
| 47 |
immediately with the corresponding exception. |
| 48 |
|
| 49 |
See: |
| 50 |
|
| 51 |
* https://github.com/python-zk/kazoo/issues/374 and |
| 52 |
* https://github.com/python-zk/kazoo/pull/570 |
| 53 |
|
| 54 |
.. autoclass:: TransactionRequest |
| 55 |
:members: |
| 56 |
:member-order: bysource |