Python function to return one or multiple responses to a NATS request as soon as possible.
Project description
nats_request_asap
Python function to return one or multiple responses to a NATS request as soon as possible.
Documentation
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)
<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_...'>]
License
This project is under the MIT License. See LICENSE.txt.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for nats_request_asap-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc1e194f9d3ac2ddb1947bbd8a756ae05d7320820d3f3cd7bb09814637da12e5 |
|
MD5 | ec97baf49eae0deabab91655d59fa175 |
|
BLAKE2b-256 | df5f4dbba46ea5a9b044eec300a640986a97d0c8a0756d6244da73d5ba803639 |