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

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

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

@app.stateful('topic2', state=deque(maxlen=10))
def process(message, state):
	event = json.loads(message.value())
	state.appendleft(event)
	new_event = state.pop()
	print(new_event)

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.0.1.tar.gz (4.0 kB view hashes)

Uploaded Source

Built Distribution

cronut-0.0.1-py2.py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 2 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