Metadata-Version: 2.1
Name: nats-request-asap
Version: 0.2.1
Summary: Python function to return one or multiple responses to a NATS request as soon as possible. 
Home-page: https://github.com/roguh/nats_request_asap
Author: Hugo O. Rivera
Author-email: hugo@roguh.com
License: BSD-2-Clause
Project-URL: Issue Tracker, https://github.com/roguh/nats_request_asap/issues
Keywords: NATS,NATS request,response as soon as possible,asap response
Platform: UNKNOWN
Classifier: Intended Audience :: Developers
Classifier: Operating System :: Unix
Classifier: Operating System :: POSIX
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Utilities
Requires-Python: >2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*
Description-Content-Type: text/markdown

# nats_request_asap

Python function to return one or multiple responses to a NATS request as soon as possible.

## 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)
<Msg: subject='_INBOX.tdSY0nNLoa9bYPqw9moCwC' reply='' data='{"initial_...'>
```

### Multiple responses

Return a list of NATS `Msg`s.

```
>>> nats_request_asap.req_asap(z, b'{"nodes": "all"}', expected=3, timeout=5)
[<Msg: subject='_INBOX.tdSY0nNLoa9bmNqw9moCwC' reply='' data='{"error": ...'>,
 <Msg: subject='_INBOX.tdSY0nNLoa9bmNqw9moCwC' reply='' data='{"initial_...'>,
 <Msg: subject='_INBOX.tdSY0nNLoa9bmNqw9moCwC' reply='' data='{"initial_...'>]
```


