MRQ: A Distributed Python Task Queue with Redis and Gevent

This repository profile is provided by osrepos.com, an open source repository discovery platform.

MRQ: A Distributed Python Task Queue with Redis and Gevent

Summary

MRQ is a distributed worker task queue written in Python, leveraging Redis and gevent for efficient task management. It aims to combine the simplicity of RQ with the performance capabilities of Celery, offering a robust solution for handling heterogeneous jobs. Developed by Pricing Assistant, it provides a comprehensive dashboard, per-job logs, and flexible job management features.

Repository Information

Analyzed by OSRepos on August 5, 2026

Topics

Click on any tag to explore related repositories

Use at your own risk

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.

Introduction

MRQ, or Mr. Queue, is a powerful and opinionated distributed worker task queue built in Python. It utilizes Redis for queue management and gevent for concurrent task execution, aiming to strike a balance between the simplicity of RQ and the high performance of Celery. Originally developed at Pricing Assistant, MRQ is designed to handle a wide range of jobs, from I/O-bound to CPU-bound tasks, efficiently and reliably.

Installation

Getting started with MRQ is straightforward. You'll need Redis and MongoDB installed and running as dependencies.

  1. Install Dependencies: Ensure you have Redis and MongoDB running.
  2. Install MRQ: Use pip to install the library.
pip install mrq
  1. Start Servers: Launch your MongoDB and Redis instances.
mongod &
redis-server &

Examples

Let's walk through a quick example to demonstrate MRQ's capabilities.

Write your first task

Create a directory and a tasks.py file with a simple task:

from mrq.task import Task
import urllib.request # Changed from urllib2 for Python 3 compatibility


class Fetch(Task):

    def run(self, params):

        with urllib.request.urlopen(params["url"]) as f:
          t = f.read()
          return len(t)

Run it synchronously

You can execute tasks directly using mrq-run:

mrq-run tasks.Fetch url http://www.google.com

This will execute the task immediately and print its result.

Run it asynchronously

To queue tasks for asynchronous processing, use mrq-run with a queue name:

mrq-run --queue fetches tasks.Fetch url http://www.google.com && \
  mrq-run --queue fetches tasks.Fetch url http://www.yahoo.com && \
  mrq-run --queue fetches tasks.Fetch url http://www.wordpress.com

These commands will add three tasks to the fetches queue. To process them, start the MRQ dashboard and a worker:

  1. Start Dashboard: mrq-dashboard & (then visit http://localhost:5555/#jobs)
  2. Start Worker: mrq-worker fetches

The worker will pick up and execute the queued jobs in parallel, and you can monitor their status through the dashboard.

Why Use MRQ?

MRQ offers a rich set of features that make it a compelling choice for distributed task management:

  • Simple Code: Designed for ease of understanding and extension, avoiding the complexity found in some other queues.
  • Great Dashboard: Provides comprehensive visibility and control over queued jobs, current jobs, and worker status.
  • Per-Job Logs: Access individual log outputs for each task directly from the dashboard.
  • Gevent Worker: Optimizes throughput for I/O-bound tasks by running them in parallel within the same UNIX process.
  • Supervisord Integration: Easily distribute CPU-bound tasks across multiple UNIX processes.
  • Job Management: Offers robust capabilities to retry, requeue, or cancel jobs programmatically or via the dashboard.
  • Performance: Includes features like bulk job queuing and easy job profiling.
  • Easy Configuration: Every aspect of MRQ is configurable through command-line flags or a dedicated configuration file.
  • Job Routing: Supports defining default queues, timeouts, and TTL values for jobs, similar to Celery.
  • Built-in Scheduler: Schedule tasks by interval or specific times of the day.
  • Strategies: Choose between sequential or parallel dequeue orders, and a burst mode for batch jobs.
  • Subqueues: Simple command-line patterns for dequeuing multiple sub-queues with auto-discovery.
  • Thorough Testing: Robustly tested against edge cases like worker interrupts and Redis failures using Docker.
  • Greenlet Tracing: Debug CPU-intensive jobs by seeing time spent in each greenlet.
  • Integrated Memory Leak Debugger: Identify and track down memory leaks within jobs using objgraph.

Links

Related repositories

Similar repositories that may be relevant next.

django-taggit: Simple Tagging for Django Applications

django-taggit: Simple Tagging for Django Applications

August 5, 2026

django-taggit offers a straightforward approach to adding tagging functionality to your Django projects. It simplifies the process of managing tags for your models, integrating seamlessly with Django's ORM, forms, and admin interface. This project is maintained by Jazzband, ensuring ongoing development and community support.

PythonDjangoTagging
nose2: The Successor to nose, Based on unittest2

nose2: The Successor to nose, Based on unittest2

August 4, 2026

nose2 is a powerful testing framework for Python, designed as the successor to the popular nose project. Built upon Python's standard `unittest` module, it extends its capabilities to provide a more flexible and feature-rich testing experience. It aims to make writing and running tests in Python simpler and more efficient.

PythonTestingUnit Testing
PyAutoGUI: Cross-Platform GUI Automation with Python

PyAutoGUI: Cross-Platform GUI Automation with Python

August 4, 2026

PyAutoGUI is an intuitive Python module designed for cross-platform GUI automation, enabling users to programmatically control the mouse and keyboard. It simplifies complex desktop interactions, allowing for tasks like clicking, typing, and taking screenshots across Windows, macOS, and Linux. This powerful library is ideal for automating repetitive tasks and creating bots.

PythonGUI AutomationDesktop Automation
Freezegun: Time Travel for Your Python Tests

Freezegun: Time Travel for Your Python Tests

August 4, 2026

Freezegun is a powerful Python library designed to simplify testing by allowing your tests to travel through time. It achieves this by mocking the `datetime` module, enabling developers to freeze time at a specific point or even simulate its progression. This functionality is crucial for ensuring consistent and reliable test results when dealing with time-sensitive logic.

PythonTestingMocking

Source repository

Open the original repository on GitHub.

View on GitHub
OS
OSRepos

Analysis and discovery of open source repositories. Find interesting projects and follow their updates.

Monitor your website with YourWebsiteScore

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of third-party repository code is at your own risk. Always review source code, dependencies, licenses, and security implications before running anything.

© 2025 OSRepos. Built with Nuxt 3 and lots of ❤️