Skip to content

Conversation

@roggervalf
Copy link
Collaborator

Why

  1. Why is this change necessary? To support drain method in python port. It also adds example codes in our docs

How

Enter the implementation details here.

Additional Notes (Optional)

Any extra info here.

Copilot AI review requested due to automatic review settings January 9, 2026 02:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for the drain method to the Python port of BullMQ, enabling removal of waiting and delayed jobs while preserving active, completed, and failed jobs. The implementation includes comprehensive tests and multilingual documentation examples.

  • Implements the drain method in both Queue and Scripts classes following existing patterns
  • Adds four comprehensive test cases covering different drain scenarios (prioritized jobs, delayed jobs with/without flag, paused queue)
  • Updates documentation with Python, Elixir, and PHP examples alongside existing TypeScript examples

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
python/bullmq/queue.py Adds the drain method to the Queue class that delegates to scripts.drain()
python/bullmq/scripts.py Registers the drain-5.lua script and implements the drain method with proper key and argument handling
python/tests/queue_test.py Adds four comprehensive test cases covering drain functionality with various scenarios
docs/gitbook/guide/queues/removing-jobs.md Adds multi-language code examples for the drain method with and without delayed parameter

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@roggervalf roggervalf requested a review from manast January 9, 2026 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants