Skip to main content

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

Project description

nats_request_asap

Documentation Status

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 Msgs.

>>> 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nats-request-asap-0.2.2.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

nats_request_asap-0.2.2-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file nats-request-asap-0.2.2.tar.gz.

File metadata

  • Download URL: nats-request-asap-0.2.2.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for nats-request-asap-0.2.2.tar.gz
Algorithm Hash digest
SHA256 db062fed189580804ded0c50155b9dac8108eec59c873069f7c1355b45f65d30
MD5 fca294d6c71a11c6879c009844c5afc2
BLAKE2b-256 6e3d11f5544b4c17ced71474628db5de4ea371150f14384a0dd776d28cbdd3df

See more details on using hashes here.

File details

Details for the file nats_request_asap-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: nats_request_asap-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for nats_request_asap-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bc1e194f9d3ac2ddb1947bbd8a756ae05d7320820d3f3cd7bb09814637da12e5
MD5 ec97baf49eae0deabab91655d59fa175
BLAKE2b-256 df5f4dbba46ea5a9b044eec300a640986a97d0c8a0756d6244da73d5ba803639

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page