https://github.com/roguh/nats_request_asap
Python function to return one or multiple responses to a NATS request as soon as possible.
https://github.com/roguh/nats_request_asap
Last synced: about 1 year ago
JSON representation
Python function to return one or multiple responses to a NATS request as soon as possible.
- Host: GitHub
- URL: https://github.com/roguh/nats_request_asap
- Owner: roguh
- License: mit
- Created: 2021-06-02T14:06:06.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2022-04-08T19:22:26.000Z (about 4 years ago)
- Last Synced: 2025-02-28T08:54:13.843Z (over 1 year ago)
- Language: Python
- Size: 19.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# nats_request_asap
# **Please use https://github.com/edf-re/nats_multi_request_py instead**
[](https://nats-request-asap.readthedocs.io/en/latest/?badge=latest)
Python function to return one or multiple responses to a NATS request as soon as possible.
## Documentation
[nats-request-asap.readthedocs.io](https://nats-request-asap.readthedocs.io/)
## Installation
```
pip install nats_request_asap
```
## Usage
### One response
Return a single NATS `Msg`.
```
>>> import nats_request_asap
>>> nats_request_asap.req_asap(z, b'{"nodes": ["af9c"]}', timeout=5)
```
### Multiple responses
Return a list of NATS `Msg`s.
```
>>> nats_request_asap.req_asap(z, b'{"nodes": "all"}', expected=3, timeout=5)
[,
,
]
```
## License
This project is under the MIT License. See [LICENSE.txt](./LICENSE.txt).