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
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.1.0.tar.gz
(4.8 kB
view hashes)
Built Distribution
Close
Hashes for cronut-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59baaaf60ce1d36e4b04642f565aba33870ceb2d62240ffb0a2a89e64e4a8cfb |
|
MD5 | 71f737a63efcb11d0ba9e7d99c5850b1 |
|
BLAKE2b-256 | db106195ac5fa9cc69425c692d0e3e12ef79d01a39897eeb3838e5a8be80579c |