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

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 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_...'>]

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.1.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

nats_request_asap-0.2.1-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nats-request-asap-0.2.1.tar.gz
  • Upload date:
  • Size: 3.0 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.1.tar.gz
Algorithm Hash digest
SHA256 c0f05116eaf95feb85ce461994bd76c29e1191e0e488631099ffe175896af04a
MD5 4c5dc3fd4b8054b25996fd3dfca0c94d
BLAKE2b-256 4dab73e501266ff3f7fbad03751c39849692d204f1809733a26463451be52d9e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nats_request_asap-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 2.7 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 834f4fc618f661ac808e93ed0fc52a65923574e5e7a7b64124a871984dc729ae
MD5 128b9a48bf124c734918f85552c75f7c
BLAKE2b-256 b5bb16e943c60562cb535c8b6d1df4817c9c638574ea07a5a6f458ce53067c40

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