No project description provided
Project description
Nats plugin for Streamz
This a plugin for Streamz that adds stream nodes for writing and reading data from/to NATS.
🛠 Installation
Latest stable version is available on PyPI
pip install streamz_nats
Latest development version can be installed from git repo
pip install git+https://github.com/MarekWadinger/streamz_nats
⚡️ Quickstart
To start working with streamz_nats, follow these 3 steps:
1. Run a standalone NATS cluster locally
docker run -t -d -p 4222:4222 --name streamz-nats nats:latest
2. Create a consumer
The following example creates a consumer of the greet.* topics, where * is
wildcard for any substring, receives incoming messages, prints the content and
ID of messages that arrive, and acknowledges each message to the Pulsar broker.
import nats
from streamz import Stream
s = Stream.from_nats(
'nats://localhost:4222',
['greet.*'],
)
s.map(lambda x: x.decode())
L = s.sink_to_list()
s.start()
while True:
try:
if L:
print(L.pop(-1))
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 Distributions
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
File details
Details for the file streamz_nats-0.1.0-py3-none-any.whl.
File metadata
- Download URL: streamz_nats-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.10.1 Darwin/23.0.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c8c4177624411d5cff465545e1e049f736c03e98bf72fe3e6e2d37cfdbb2bad
|
|
| MD5 |
ccd79fc517ed40eed3e2f73c5aa8dc5e
|
|
| BLAKE2b-256 |
b4d1cb7628fcfe573675e39a61ee50f0c6d3816a8c1d9c45f2c3688c3303f9d1
|