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.

Files for cronut, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size cronut-0.1.0-py2.py3-none-any.whl (5.4 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size cronut-0.1.0.tar.gz (4.8 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page