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 details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cronut-0.1.0.tar.gz.
File metadata
- Download URL: cronut-0.1.0.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4693ee5464f037445e64fe0cacb369bb2e9e698fe9256c499a56738bbef32a85
|
|
| MD5 |
693bafe641328d55ec56e7341580fb33
|
|
| BLAKE2b-256 |
1bfe7d79bd531532954db91d4a37a92f9fddc11420a787289b0e5ceb84784bde
|
File details
Details for the file cronut-0.1.0-py2.py3-none-any.whl.
File metadata
- Download URL: cronut-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59baaaf60ce1d36e4b04642f565aba33870ceb2d62240ffb0a2a89e64e4a8cfb
|
|
| MD5 |
71f737a63efcb11d0ba9e7d99c5850b1
|
|
| BLAKE2b-256 |
db106195ac5fa9cc69425c692d0e3e12ef79d01a39897eeb3838e5a8be80579c
|