An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

          

# nats_request_asap

# **Please use https://github.com/edf-re/nats_multi_request_py instead**

[![Documentation Status](https://readthedocs.org/projects/nats-request-asap/badge/?version=latest)](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).