NATS core implementation in Python
Project description
NATS Client
A Python client for the NATS messaging system.
Features
- Support for publish/subscribe
- Support for request/reply
- Support for queue groups
- Support for multi-value message headers
Installation
pip install nats-core
Usage
import asyncio
from nats.client import connect
async def main():
client = await connect("nats://localhost:4222")
# Subscribe
async with await client.subscribe("foo") as subscription:
# Publish
await client.publish("foo", "Hello World!")
# Receive message
message = await subscription.next()
print(f"Received: {message.data}")
await client.close()
if __name__ == "__main__":
asyncio.run(main())
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
nats_core-0.2.0.tar.gz
(22.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
nats_core-0.2.0-py3-none-any.whl
(26.4 kB
view details)
File details
Details for the file nats_core-0.2.0.tar.gz.
File metadata
- Download URL: nats_core-0.2.0.tar.gz
- Upload date:
- Size: 22.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0299490b263d67cd298c9eeafb0634b067bd064eb56568ecc75698a5efc49fe
|
|
| MD5 |
872f62f600da37c57ab6008657d998a0
|
|
| BLAKE2b-256 |
06ecda29ae3ff515c561f8cb8c4c6a6a6ab936261a9d590a8a6249885e261be2
|
File details
Details for the file nats_core-0.2.0-py3-none-any.whl.
File metadata
- Download URL: nats_core-0.2.0-py3-none-any.whl
- Upload date:
- Size: 26.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86ffc0531509945cc114c03c25b6d9b1a0a4ff1f5a6a30074e3a43d3fbefa687
|
|
| MD5 |
7abd1d8326f2f5fbfc59cbc8da9ed8a3
|
|
| BLAKE2b-256 |
7ace1957df7551c21d6948105c772f86a9bbd7f8371a1e47f7844bc7ce86a2b0
|