KQ is a simple Python library for queueing tasks to Kafka. These task are processed asynchronously by workers.
KQ currently supports enqueueing any arbitrary python function.
- Python 3.7+
- Apache Kafka 0.10+
pip install async-kq
def test_fn(x):
print(x)
from kq.queue import Queue
q = Queue(topic="my-topic", broker=["localhost:9092"])
q.enqueue(task=task,args=[10])
kq --topic my-topic --group-id my-test-group --brokers localhost:9092
Starting a worker with the following args: my-topic, test-group-id, ('localhost:9092',)
Executing Task: fn: task, args: [10], kwargs: {}
10