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
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 Distribution
cronut-0.0.1.tar.gz
(4.0 kB
view hashes)
Built Distribution
Close
Hashes for cronut-0.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d93a201371fdde5fd9a649511694eeb80669c74039b3b7103c7652d14d36efdb |
|
MD5 | c17c2e8d3e55926407f4762534c9c989 |
|
BLAKE2b-256 | 0a3d4a2a1186185a648daa14cf0704f21babb08e37d51225ecd7550d7d77669f |