Browse Source

Updated documentation on message queue manager classes

pull/348/head
Miguel Grinberg 6 years ago
parent
commit
f36fa88d9e
No known key found for this signature in database GPG Key ID: 36848B262DF5F06C
  1. 12
      docs/api.rst
  2. 27
      docs/server.rst

12
docs/api.rst

@ -108,6 +108,12 @@ API Reference
.. autoclass:: RedisManager .. autoclass:: RedisManager
:members: :members:
``KafkaManager`` class
----------------------
.. autoclass:: KafkaManager
:members:
``AsyncManager`` class ``AsyncManager`` class
---------------------- ----------------------
@ -120,3 +126,9 @@ API Reference
.. autoclass:: AsyncRedisManager .. autoclass:: AsyncRedisManager
:members: :members:
``AsyncAioPikaManager`` class
---------------------------
.. autoclass:: AsyncAioPikaManager
:members:

27
docs/server.rst

@ -517,20 +517,37 @@ the correct URL for a given message queue.
Note that Kombu currently does not support asyncio, so it cannot be used with Note that Kombu currently does not support asyncio, so it cannot be used with
the :class:`socketio.AsyncServer` class. the :class:`socketio.AsyncServer` class.
Kafka
~~~~~
`Apache Kafka <https://kafka.apache.org/>`_ is supported through the
`kafka-python <https://kafka-python.readthedocs.io/en/master/index.html>`_
package::
pip install kafka-python
Access to Kafka is configured through the :class:`socketio.KafkaManager`
class::
mgr = socketio.KafkaManager('kafka://')
sio = socketio.Server(client_manager=mgr)
Note that Kafka currently does not support asyncio, so it cannot be used with
the :class:`socketio.AsyncServer` class.
AioPika AioPika
~~~~~~~ ~~~~~~~
If you want to combine a RabbitMQ based manager with asyncio and a A RabbitMQ message queue is supported in asyncio applications through the
:class:`socketio.AsyncServer` class, you can use the `AioPika <https://aio-pika.readthedocs.io/en/latest/>`_ package::
`AioPika <https://aio-pika.readthedocs.io/en/latest/>`_ based manager.
You need to install aio_pika with pip:: You need to install aio_pika with pip::
pip install aio_pika pip install aio_pika
The RabbitMQ queue is configured through the The RabbitMQ queue is configured through the
:class:`socketio.AsyncPubSubAioPikaManager`:: :class:`socketio.AsyncAioPikaManager` class::
mgr = socketio.AsyncPubSubAioPikaManager('amqp://') mgr = socketio.AsyncAioPikaManager('amqp://')
sio = socketio.AsyncServer(client_manager=mgr) sio = socketio.AsyncServer(client_manager=mgr)
Emitting from external processes Emitting from external processes

Loading…
Cancel
Save