NATS Request Many
This is not an official NATS project
This is a personal project and is not endorsed by the NATS.io community. It is not guaranteed to be maintained or supported.
This is an experimental project
This project is a prototype and should not be used for anything serious. It is not well tested, nor is it guaranteed to be correct.
The nats.deno package (Deno client for NATS) provides a simple way to request many responses from a singe NATS request.
This project is an attempt to implement the same API in Python.
References
-
The reference document I've used is this PR (not merged at the moment) ADR-??: Request Many.
-
The reference implementation is in the nats.deno package.
How to install
pip install nats-request-many
Example usage
Run the script using:
python examples/minimal.py
2024-02-21 03:05:16,759 - request_many - INFO - sending request to subject 'foo'
2024-02-21 03:05:16,760 - request_many - INFO - sub1 received a message sub1 on foo
2024-02-21 03:05:16,760 - request_many - INFO - sub2 received a message on foo
Received a reply: OK
Received a reply: OK
2024-02-21 03:05:16,761 - request_many - INFO - sending request to subject 'foo'
2024-02-21 03:05:16,762 - request_many - INFO - sub1 received a message sub1 on foo
2024-02-21 03:05:16,762 - request_many - INFO - sub2 received a message on foo
Received a reply: OK
Received a reply: OK
2024-02-21 03:05:16,759 - request_many - INFO - sending request to subject 'foo'
2024-02-21 03:05:16,760 - request_many - INFO - sub1 received a message sub1 on foo
2024-02-21 03:05:16,760 - request_many - INFO - sub2 received a message on foo
Received a reply: OK
Received a reply: OK
2024-02-21 03:05:16,761 - request_many - INFO - sending request to subject 'foo'
2024-02-21 03:05:16,762 - request_many - INFO - sub1 received a message sub1 on foo
2024-02-21 03:05:16,762 - request_many - INFO - sub2 received a message on foo
Received a reply: OK
Received a reply: OK