@@ -51,8 +51,32 @@ export LDFLAGS="-L/usr/lib/x86_64-linux-gnu"
5151pip install " python-qpid-proton>=0.39.0,<0.40.0" --no-binary python-qpid-proton --verbose --no-cache-dir
5252```
5353
54+ ### Async Interface (Experimental)
5455
56+ The client provides an async interface via the ` rabbitmq_amqp_python_client.asyncio ` module. The async classes act as facades that:
5557
58+ - Wrap the corresponding synchronous classes
59+ - Execute blocking operations in a thread pool executor using ` run_in_executor `
60+ - Coordinate concurrent access using ` asyncio.Lock `
61+ - Implement proper async context managers (` async with ` ) for resource management
62+ - Maintain API compatibility with the synchronous version
5663
64+ ** Key differences from the synchronous interface:**
65+
66+ 1 . Use ` AsyncEnvironment ` instead of ` Environment `
67+ 2 . All operations must be awaited with ` await `
68+ 3 . Use ` async with ` for resource management (connections, publishers, consumers, management)
69+ 4 . Consumer signal handling uses ` asyncio.Event ` and ` loop.add_signal_handler `
70+
71+ For a complete example showing proper consumer termination and signal handling, refer to:
72+
73+ - [ examples/getting_started/getting_started_async.py] ( ./examples/getting_started/getting_started_async.py )
74+
75+ Additional async examples are available in the [ examples] ( ./examples ) folder:
76+
77+ - OAuth2: [ examples/oauth/oAuth2_async.py] ( ./examples/oauth/oAuth2_async.py )
78+ - Reconnection: [ examples/reconnection/reconnection_example_async.py] ( ./examples/reconnection/reconnection_example_async.py )
79+ - Streams: [ examples/streams/example_with_streams_async.py] ( ./examples/streams/example_with_streams_async.py )
80+ - TLS: [ examples/tls/tls_example_async.py] ( ./examples/tls/tls_example_async.py )
5781
5882
0 commit comments