diff --git a/coolamqp/clustering/cluster.py b/coolamqp/clustering/cluster.py index 0760c9d7c1810f3b3050700c997e2d328b0a8623..39305772782cfcfc06345dfca0c58cfbd85c29e5 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 c49b6cf38dfc513b82d565f807d048837cefda11..5894bade587532025fdfd3c33a626dc70517b078 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)