aioworkers plugin for kafka
Project description
Usage
config.yaml:
producer:
cls: aioworkers_kafka.producer.KafkaProducer
format: json
kafka:
bootstrap.servers: kafka:9092
topic: test
consumer:
cls: aioworkers_kafka.consumer.KafkaConsumer
format: json # default format is json
kafka:
bootstrap.servers: kafka:9092
group.id: test
topics:
- test
worker:
cls: mymodule.MyWorker
input: .consumer
output: .producer
autorun: true
mymodule.py:
from aioworkers.worker.base import Worker
class MyWorker(Worker):
async def run(self, value): # consume value from input
assert isinstance(value, dict)
value["test"] += 1
return value # produce value to output
$ aioworkers -c config.yaml
Development
Check code:
hatch run lint:all
Format code:
hatch run lint:fmt
Run tests:
hatch run pytest
Run tests with coverage:
hatch run cov
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
aioworkers_kafka-0.2.0.tar.gz
(10.3 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 aioworkers_kafka-0.2.0.tar.gz.
File metadata
- Download URL: aioworkers_kafka-0.2.0.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
453d9a1039182692b9ba38f8c904b4fe7cd185fdb4ca352ae653130603ba22ed
|
|
| MD5 |
be246c116bd6de67f6878126053f3386
|
|
| BLAKE2b-256 |
28fa80c3f5550b6a6c3333cf1ea9e39479470f90a30b4f0caceffce7b805c30c
|
File details
Details for the file aioworkers_kafka-0.2.0-py3-none-any.whl.
File metadata
- Download URL: aioworkers_kafka-0.2.0-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8cc731deeea3e930830b30cfd6b35d08af693502d71c805314f8fc56437ac784
|
|
| MD5 |
90b7cfc7ca7e75ca0a8386ea10e7f3f2
|
|
| BLAKE2b-256 |
ff3e8e9e2e794037429269238143e57e8f366d5fd97321999d73def4b5c3573a
|