A lightweight Messaging queue implementation using Redis for producer-worker-subscriber messaging.
Project description
RedQLite
A lightweight Messaging queue implementation using Redis for producer-worker messaging.
Features
- Redis-backed message queuing
- Producer and worker interface
- Lightweight and fast alternative to Kafka
- Works for long running tasks
- Provides configurable heartbeats from inside worker callback functions
- Redis server required
- Minimal setup — no Kafka or Zookeeper required
Installation
pip install redqlite
How It Works
This package simulates a basic Kafka-style messaging system using Redis lists. It includes:
A Producer that pushes messages to a Redis queue or broadcasts messages to all subscribers.
A Worker that consumes messages from the queue and processes them.
A Worker Pool to run concurrent workers.
A Subscriber that consumes messages from channel specific message queue.
Usage
Example: Producing a Message
# Import RQProducer class
from redqlite.producer import RQProducer
# Create a producer instance (assumes redis running on localhost:6379)
rqproducer = RQProducer()
# Send a message
rqproducer.send(topic="your_topic_name", message="hello world")
# Broadcast message on a channel
rqproducer.broadcast(channel="your_channel_name", message="hello world")
Example: Starting a Worker
# Import QWorker class
from redqlite.worker import RQWorker
def callback_func(msg, **kwargs):
print(msg)
# Create a worker instance (assumes redis running on localhost:6379)
rqworker = RQWorker(topic="your_topic_name", callback=callback_func)
# Start worker thread
rqworker.start()
Example: Starting a subscriber
# Import QSubscriber class
from redqlite.subscriber import RQSubscriber
def callback_func(msg, **kwargs):
print(msg)
# Create a worker instance (assumes redis running on localhost:6379)
rqsubscriber = RQSubscriber(channel="your_channel_name", callback=callback_func)
# Start subscriber thread
rqsubscriber.start()
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you’d like to change.
Contact
Created by Shashank Gandhi – feel free to reach out by opening an issue or by contacting the author.
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
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 redqlite-1.0.0.tar.gz.
File metadata
- Download URL: redqlite-1.0.0.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e1503f761fd537741718067ee6f7dce5314a8a85d77916932ce51f88d8d5341
|
|
| MD5 |
9c60c9f12ab5cb20770b7174b0e62ed7
|
|
| BLAKE2b-256 |
581656ce0c3f10a24be5a3dfc6b63281e7922eec7104a7a977c1d703209de7e7
|
File details
Details for the file redqlite-1.0.0-py3-none-any.whl.
File metadata
- Download URL: redqlite-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27bb500156721794484735a9c2f49369086ccb78ddc761583f35322bfde50658
|
|
| MD5 |
caf928b1bb06718aed6217edd32a6ec4
|
|
| BLAKE2b-256 |
2ea46ed8f1c9ee0f1260fee9bf4081d03f597252fc56b4a63335743a7771bce2
|