Download the PHP package harrisonratcliffe/laravel-queue-watch without Composer

On this page you can find all versions of the php package harrisonratcliffe/laravel-queue-watch. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-queue-watch

# ๐Ÿ” Laravel Queue Watch **Auto-restart your Laravel queue worker whenever your code changes.** Pure PHP polling โ€” no Node, no npm, no extensions. [![Latest Version on Packagist](https://img.shields.io/packagist/v/harrisonratcliffe/laravel-queue-watch.svg?style=flat-square)](https://packagist.org/packages/harrisonratcliffe/laravel-queue-watch) [![Tests](https://img.shields.io/github/actions/workflow/status/harrisonratcliffe/laravel-queue-watch/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/harrisonratcliffe/laravel-queue-watch/actions?query=workflow%3Arun-tests+branch%3Amain) [![Code Style](https://img.shields.io/github/actions/workflow/status/harrisonratcliffe/laravel-queue-watch/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/harrisonratcliffe/laravel-queue-watch/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain) [![PHPStan](https://img.shields.io/github/actions/workflow/status/harrisonratcliffe/laravel-queue-watch/phpstan.yml?branch=main&label=phpstan&style=flat-square)](https://github.com/harrisonratcliffe/laravel-queue-watch/actions?query=workflow%3APHPStan+branch%3Amain) [![Total Downloads](https://img.shields.io/packagist/dt/harrisonratcliffe/laravel-queue-watch.svg?style=flat-square)](https://packagist.org/packages/harrisonratcliffe/laravel-queue-watch) [![License](https://img.shields.io/packagist/l/harrisonratcliffe/laravel-queue-watch.svg?style=flat-square)](LICENSE)

What it does

php artisan queue:watch runs queue:work as a long-lived child process and restarts it automatically whenever your application code changes โ€” so you get a production-like queue worker that picks up your edits without you stopping and starting it by hand.

That's the whole thing. Edit a job, save, and the worker is already running your new code.


๐Ÿค” Why polling?

Most file watchers โ€” including the Node/chokidar-based packages this one replaces โ€” rely on OS-level filesystem events like inotify. That works beautifully on bare metal. It's unreliable in the environment most Laravel developers actually use day to day: Docker on macOS or Windows, where your app runs in a Linux container over a bind-mounted volume from the host.

Host-side edits are frequently invisible to inotify inside the container, because the bind mount doesn't propagate native filesystem events across the VM boundary. The watcher doesn't error โ€” it just silently never fires.

Polling sidesteps this entirely:

Statting a few thousand files once a second is negligible overhead. In exchange you get a watcher that actually works everywhere, every time. That reliability โ€” not raw speed โ€” is this package's main advantage over the Node-based alternatives.

How it compares

queue:watch queue:listen Node-based watchers
Requires Node/npm โŒ No โŒ No โœ… Yes
Reloads code on change โœ… Yes โœ… Yes (every job) โœ… Yes
Runs a persistent worker โœ… Yes โŒ No โ€” fresh process per job โœ… Yes
Restart behaviour Graceful โ€” SIGTERM, waits for the current job, then SIGKILL N/A Package-dependent, often a hard kill
Reliable under Docker bind mounts โœ… Yes (polling) N/A โš ๏ธ Often not (inotify)

[!NOTE] queue:listen already reloads code on every job โ€” it just does so by booting the framework from scratch each time, which is the exact overhead queue:work exists to avoid. queue:watch is for people who want queue:work's persistent, production-like execution model and automatic reloading on change.


๐Ÿ“ฆ Installation

Requirements: PHP 8.2+ and Laravel 11, 12, or 13.

That's it โ€” the package works out of the box with zero configuration.

To customise it, publish the config file:


๐Ÿš€ Usage

This starts queue:work and watches your application for changes, restarting the worker gracefully whenever it detects one.

Forwarded to queue:work

Common worker options are passed straight through to the underlying process:

Option Description
--queue= Which queue(s) to process
--connection= Which queue connection to use
--timeout= Max seconds a child job may run
--tries= Attempts before a job is failed
--memory= Memory limit in megabytes
--sleep= Seconds to sleep when no job is available

Watcher options

Option Description
--path=* Extra path to watch, merged with config (repeatable)
--poll= Polling interval in milliseconds (default 1000)
--extensions= Comma-separated extensions to watch (default php)
--no-restart-on-env Don't watch .env for changes

Examples:


โš™๏ธ Configuration

[!TIP] Watching a large resources/ tree and finding restarts sluggish? Trim paths down to what actually affects your jobs โ€” usually just app, config, and .env.


๐Ÿ›ก๏ธ Graceful restarts

Naively killing a queue worker to restart it is dangerous. A job can be mid-flight when the worker dies, and with a database queue driver that job then sits reserved until it times out, only to retry โ€” duplicating side effects if the original invocation had already partially completed.

queue:watch avoids this:

  1. SIGTERM is sent to the worker.
  2. Laravel's worker responds by finishing the job it's currently processing, then exiting cleanly.
  3. If it hasn't exited within restart_timeout seconds (default 10), it's escalated to SIGKILL.
  4. A fresh worker is spawned with your updated code.

[!WARNING] Windows limitation. POSIX signals need ext-pcntl, which isn't available on Windows, so this graceful handshake isn't possible there โ€” queue:watch falls back to a hard stop, the same as Process::stop() would. A restart can therefore interrupt an in-flight job, and Ctrl+C won't get the chance to shut the worker down cleanly. WSL2 is strongly recommended on Windows.

When the worker exits on its own

If the worker dies by itself โ€” a crash, --max-jobs, or an internal queue:restart โ€” queue:watch reports the exit code and respawns it rather than hanging or exiting silently.

A worker that exits immediately is treated as a failure rather than a restart: repeated fast exits back off exponentially (250ms, doubling, capped at 10s) and queue:watch gives up after 10 in a row. This keeps a genuinely broken worker โ€” a bad worker_command, a missing artisan, a boot-time exception โ€” from being respawned in a tight loop that scrolls the underlying error out of view. Any worker that stays up for 5 seconds clears the streak.


๐Ÿงช Testing

Contributing

Contributions are welcome โ€” please see CONTRIBUTING for details.

Changelog

See CHANGELOG for what's changed recently.

Security

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see the License File for more information.


All versions of laravel-queue-watch with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/console Version ^11.0||^12.0||^13.0
illuminate/support Version ^11.0||^12.0||^13.0
symfony/process Version ^6.0||^7.0||^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package harrisonratcliffe/laravel-queue-watch contains the following files

Loading the files please wait ...