PHPackages                             rvxlab/laravel-metronome - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. rvxlab/laravel-metronome

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rvxlab/laravel-metronome
========================

Run Laravel's task scheduler using an event loop instead of cron or sleep

0.1.1(3mo ago)10MITPHPPHP ^8.2CI passing

Since Mar 22Pushed 3mo agoCompare

[ Source](https://github.com/RVxLab/laravel-metronome)[ Packagist](https://packagist.org/packages/rvxlab/laravel-metronome)[ RSS](/packages/rvxlab-laravel-metronome/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (2)Dependencies (10)Versions (3)Used By (0)

Laravel Metronome
=================

[](#laravel-metronome)

A drop-in replacement for Laravel's built-in scheduler using an event loop instead of Cron.

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 12+
- `ext-pcntl`

Installation
------------

[](#installation)

```
composer require rvxlab/laravel-metronome
```

Usage
-----

[](#usage)

Replace your `schedule:work` invocation with:

```
php artisan schedule:metronome
```

### Tick rate

[](#tick-rate)

The tick rate controls how often the scheduler checks for due tasks in seconds. By default, the tick rate is 1 second. You can change the tick rate by passing the `--tick-rate` or `-t` option:

```
# Default, suitable for most workloads
php artisan schedule:metronome --tick-rate=1

# Check twice per second, useful for high-frequency sub-minute tasks
php artisan schedule:metronome --tick-rate=0.5

# Minimum allowed value (100 times per second), rarely needed in practice
php artisan schedule:metronome --tick-rate=0.01
```

Lower tick rates increase the number of times the scheduler checks for due tasks, which can be helpful if your workload relies on sub-minute scheduling or if you have a large number of small tasks scheduled. It's worth keeping in mind that lowering the tick rate will increase the CPU usage slightly. In most cases the difference is negligible (&lt; 0.1%).

Overlap Protection
------------------

[](#overlap-protection)

Metronome makes use of Laravel's overlap protection, exactly how the built-in scheduler works.

Calls to `->withoutOverlapping()` will continue to work as expected.

Long-running tasks
------------------

[](#long-running-tasks)

As with Laravel's built-in scheduler, synchronous tasks that run long will delay later ticks. For tasks expected to take more than a second or two, use `->runInBackground()` to shell out a child process instead.

```
$schedule->command('orders:process')->everyMinute()->runInBackground();
```

Running with Supervisor
-----------------------

[](#running-with-supervisor)

Add the following to your Supervisor configuration, adjusting `command`, `user`, and `stdout_logfile` to match your setup.

```
[program:laravel-metronome]
process_name = %(program_name)s_%(process_num)02d
command = php /var/www/html/artisan schedule:metronome
autostart = true
autorestart = true
stopasgroup = true
killasgroup = true
user = www-data
numprocs = 1
redirect_stderr = true
stdout_logfile = /var/www/html/storage/logs/metronome.log
stopwaitsecs = 60
```

`numprocs` must be `1`. Running multiple instances will cause tasks to fire multiple times. `stopwaitsecs` should be set high enough to allow any currently running tasks to finish before Supervisor force-kills the process.

Running with Docker
-------------------

[](#running-with-docker)

Because Metronome doesn't rely on Cron, it's really easy to have it run in a Docker container, either directly or through Supervisor.

Without Supervisor, you can run the scheduler directly as the container's entrypoint:

```
FROM php:8.2-cli

RUN docker-php-ext-install pcntl

WORKDIR /var/www/html

COPY . .

CMD ["php", "artisan", "schedule:metronome"]
```

Or with Supervisor, if you need it running alongside other processes:

```
FROM php:8.2-cli

RUN apt-get update && apt-get install -y \
        supervisor \
    && rm -rf /var/lib/apt/lists/* \
    && docker-php-ext-install pcntl

WORKDIR /var/www/html

COPY . .

COPY supervisord.conf /etc/supervisor/conf.d/laravel-metronome.conf

CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/supervisord.conf"]
```

Stopping the Scheduler
----------------------

[](#stopping-the-scheduler)

Send `SIGINT` (Ctrl+C) or `SIGTERM` to stop the process cleanly. Laravel's shutdown logic runs before the process exits, so process managers like Supervisor and systemd work out of the box.

Known limitations
-----------------

[](#known-limitations)

- Last-run state is held in memory and not persisted across process restarts. A task that ran shortly before a crash may re-run immediately on startup.

License
-------

[](#license)

This package is licensed under [MIT](./LICENSE).

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance82

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

97d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/46111684?v=4)[rvxlab](/maintainers/rvxlab)[@RVxLab](https://github.com/RVxLab)

---

Top Contributors

[![RVxLab](https://avatars.githubusercontent.com/u/46111684?v=4)](https://github.com/RVxLab "RVxLab (38 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/rvxlab-laravel-metronome/health.svg)

```
[![Health](https://phpackages.com/badges/rvxlab-laravel-metronome/health.svg)](https://phpackages.com/packages/rvxlab-laravel-metronome)
```

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

9782.1M162](/packages/laravel-ai)[spatie/laravel-export

Create a static site bundle from a Laravel app

672139.5k6](/packages/spatie-laravel-export)[tallstackui/tallstackui

TallStackUI is a powerful suite of Blade components that elevate your workflow of Livewire applications.

721160.4k12](/packages/tallstackui-tallstackui)[zidbih/laravel-deadlock

Make temporary Laravel workarounds expire and fail CI when ignored.

984.0k](/packages/zidbih-laravel-deadlock)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

19253.0k3](/packages/interaction-design-foundation-laravel-geoip)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
