File: quick-start.rst

package info (click to toggle)
python-aio-pika 9.5.6-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,428 kB
  • sloc: python: 8,009; makefile: 36; xml: 1
file content (64 lines) | stat: -rw-r--r-- 1,366 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
Quick start
+++++++++++

Some useful examples.

Simple consumer
~~~~~~~~~~~~~~~

.. literalinclude:: examples/simple_consumer.py
   :language: python

Simple publisher
~~~~~~~~~~~~~~~~

.. literalinclude:: examples/simple_publisher.py
   :language: python

Asynchronous message processing
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. literalinclude:: examples/simple_async_consumer.py
   :language: python


Working with RabbitMQ transactions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. literalinclude:: examples/simple_publisher_transactions.py
   :language: python

Get single message example
~~~~~~~~~~~~~~~~~~~~~~~~~~

.. literalinclude:: examples/main.py
   :language: python

Set logging level
~~~~~~~~~~~~~~~~~

Sometimes you want to see only your debug logs, but when you just call
`logging.basicConfig(logging.DEBUG)` you set the debug log level for all
loggers, includes all aio_pika's modules. If you want to set logging level
independently see following example:

.. literalinclude:: examples/log-level-set.py
   :language: python

Tornado example
~~~~~~~~~~~~~~~

.. literalinclude:: examples/tornado-pubsub.py
   :language: python

External credentials example
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. literalinclude:: examples/external-credentials.py
   :language: python

Connection pooling
~~~~~~~~~~~~~~~~~~

.. literalinclude:: examples/pooling.py
   :language: python