Skip to main content

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


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

streamz_nats-0.1.0-py3-none-any.whl (3.9 kB view hashes)

Uploaded Python 3

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