Skip to main content

Tasty event processing with Kafka

Project description

Cronut

cronut is a barebones event processing library using Kafka.

Quickstart

from collections import deque
import json

from cronut import App

d = deque(maxlen=30)

app = App('myapp', broker='kafka://localhost:9096')

@app.process('topic1')
def stateless(message):
    event = json.loads(message.value())
    print(event)

@app.process('topic2', state=d)
def stateful(message, state):
    event = json.loads(message.value())
    state.appendleft(event)

@app.timer(interval=0.1, state=d)
def retrieve(state):
    event = state.pop()
    print(event)

@app.timer(interval=0.1)
def greet():
    print('howdy')

app.start()

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

cronut-0.1.0.tar.gz (4.8 kB view hashes)

Uploaded source

Built Distribution

cronut-0.1.0-py2.py3-none-any.whl (5.4 kB view hashes)

Uploaded py2 py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page