From 97cdb39802a6456bbe4301eda8a80b5be76b37be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Ma=C5=9Blanka?= <piotr.maslanka@henrietta.com.pl> Date: Wed, 13 Nov 2024 13:57:05 +0100 Subject: [PATCH] docs fix --- coolamqp/clustering/cluster.py | 28 +++++++++++++++------------- docs/how-to-guide.rst | 4 ++-- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/coolamqp/clustering/cluster.py b/coolamqp/clustering/cluster.py index 0760c9d..3930577 100644 --- a/coolamqp/clustering/cluster.py +++ b/coolamqp/clustering/cluster.py @@ -35,25 +35,13 @@ class Cluster(object): Call .start() to connect to AMQP. It is not safe to fork() after .start() is called, but it's OK before. - - :param nodes: list of nodes, or a single node. For now, only one is supported. - :param on_fail: callable/0 to call when connection fails in an - unclean way. This is a one-shot - :param extra_properties: refer to :class:`coolamqp.uplink.connection.Connection` - :param log_frames: an object that supports logging each and every frame CoolAMQP sends and - receives from the broker - :type log_frames: tp.Optional[:class:`coolamqp.tracing.BaseFrameTracer`] - :param name: name to appear in log items and prctl() for the listener thread - :param on_blocked: callable to call when ConnectionBlocked/ConnectionUnblocked is received. It will be - called with a value of True if connection becomes blocked, and False upon an unblock - :param tracer: tracer, if opentracing is installed """ # Events you can be informed about ST_LINK_LOST = 0 # Link has been lost ST_LINK_REGAINED = 1 # Link has been regained - def __init__(self, nodes, # type: tp.Union[NodeDefinition, tp.List[NodeDefinition]] + def __init__(self, nodes, # type: NodeDefinition on_fail=None, # type: tp.Optional[tp.Callable[[], None]] extra_properties=None, # type: tp.Optional[tp.List[tp.Tuple[bytes, tp.Tuple[bytes, str]]]] @@ -62,6 +50,20 @@ class Cluster(object): on_blocked=None, # type: tp.Callable[[bool], None], tracer=None # type: opentracing.Traccer ): + """ + :param nodes: single node + :type nodes: NodeDefinition + :param on_fail: callable/0 to call when connection fails in an + unclean way. This is a one-shot + :param extra_properties: refer to :class:`coolamqp.uplink.connection.Connection` + :param log_frames: an object that supports logging each and every frame CoolAMQP sends and + receives from the broker + :type log_frames: tp.Optional[:class:`coolamqp.tracing.BaseFrameTracer`] + :param name: name to appear in log items and prctl() for the listener thread + :param on_blocked: callable to call when ConnectionBlocked/ConnectionUnblocked is received. It will be + called with a value of True if connection becomes blocked, and False upon an unblock + :param tracer: tracer, if opentracing is installed + """ from coolamqp.objects import NodeDefinition if isinstance(nodes, NodeDefinition): nodes = [nodes] diff --git a/docs/how-to-guide.rst b/docs/how-to-guide.rst index c49b6cf..5894bad 100644 --- a/docs/how-to-guide.rst +++ b/docs/how-to-guide.rst @@ -1,5 +1,5 @@ -Tutorial -======== +How to guide +============ If you want to connect to an AMQP broker, you need: * its address (and port) -- GitLab