Skip to content

Commit 23cd38d

Browse files
committed
update readme
1 parent 2c63373 commit 23cd38d

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,32 @@ export LDFLAGS="-L/usr/lib/x86_64-linux-gnu"
5151
pip 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

Comments
 (0)