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.1.0.tar.gz
(51.6 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.1.0-py3-none-any.whl
(25.8 kB
view details)
File details
Details for the file nats_core-0.1.0.tar.gz.
File metadata
- Download URL: nats_core-0.1.0.tar.gz
- Upload date:
- Size: 51.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
091be9852adb4014df6f17cf535e93824b9aa5174a7a539b9946e0de2dab9f32
|
|
| MD5 |
c1203e37b5f35ff82c85b68b174d4c45
|
|
| BLAKE2b-256 |
6326db4da298d3676eaa8babe2bb9827b023f408228387cb9fe2562b3238a2d6
|
File details
Details for the file nats_core-0.1.0-py3-none-any.whl.
File metadata
- Download URL: nats_core-0.1.0-py3-none-any.whl
- Upload date:
- Size: 25.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0be0b390fff9b5907dd7f64d1baa08b7ff8b83c4a1d95703dc8cf7f0f53d5f4
|
|
| MD5 |
7f69cee9f6dccbb3b8d34386c3a4f358
|
|
| BLAKE2b-256 |
6d07883d44aef7d74b7823a2ae68aef7cf044d99fa3585d2d4fb26b5e419cbc5
|