Skip to content

Conversation

@MrPunyapal
Copy link
Contributor

@MrPunyapal MrPunyapal commented Dec 3, 2025

PR: Add pausable queue support with callable option

Summary

  • Adds configuration and runtime control to let workers optionally check the cache for per-queue pause signals.
  • The change is small in code: expose QueueManager::pausable() and evaluate Worker::$pausable in Worker::queuePaused().

Motivation

Allow dynamic control over whether workers poll the cache for pause signals so you can reduce cache overhead, apply special rules to certain connections/queues, or disable pause-checking in non-production environments.

Usage examples

Enable globally (default):

Queue::pausable(true);

Disable globally:

Queue::pausable(false);

Conditional pause-checking per connection/queue:

Queue::pausable(function (string $connection, string $queue) {
    // only check pause status for redis default queue
    return $connection === 'redis' && $queue === 'default';
});

@github-actions
Copy link

github-actions bot commented Dec 3, 2025

Thanks for submitting a PR!

Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface.

Pull requests that are abandoned in draft may be closed due to inactivity.

@MrPunyapal
Copy link
Contributor Author

I wonder if it should also affect the pause and pauseFor I mean if it is not pausable it cannot be paused by pause and pauseFor does it make sense than I'm up for implementing it.

@MrPunyapal MrPunyapal marked this pull request as ready for review December 3, 2025 18:40
@MrPunyapal MrPunyapal marked this pull request as draft December 3, 2025 18:50
@MrPunyapal MrPunyapal marked this pull request as ready for review December 3, 2025 18:50
@taylorotwell
Copy link
Member

Thanks for your pull request to Laravel!

Unfortunately, I'm going to delay merging this code for now. To preserve our ability to adequately maintain the framework, we need to be very careful regarding the amount of code we include.

If applicable, please consider releasing your code as a package so that the community can still take advantage of your contributions!

@MrPunyapal MrPunyapal deleted the feat/pausable-queue-with-callable branch December 4, 2025 17:32
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.

3 participants