PHPackages                             dinoqqq/crystal - 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. [Queues &amp; Workers](/categories/queues)
4. /
5. dinoqqq/crystal

ActiveLibrary[Queues &amp; Workers](/categories/queues)

dinoqqq/crystal
===============

Queue worker to easily manage recurring tasks

v3.1(1mo ago)110.1k↑128.6%3[1 issues](https://github.com/dinoqqq/crystal/issues)MITPHPPHP &gt;=7.2

Since Jul 7Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/dinoqqq/crystal)[ Packagist](https://packagist.org/packages/dinoqqq/crystal)[ RSS](/packages/dinoqqq-crystal/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (8)Dependencies (10)Versions (28)Used By (0)

Crystal: A queue worker for recurring tasks
===========================================

[](#crystal-a-queue-worker-for-recurring-tasks)

Crystal is a queue worker optimized for recurring tasks that need to be processed in an easy manageable way.

Features
--------

[](#features)

- A clear overview of which tasks are recurring (in a DB table).
- Graceful shutdown of tasks (needed for tasks that have an unknown running time).
- Manageable system resources; by setting the total number of tasks/processes allowed to be processed simultaneously.
- Configurable dependencies between tasks (order of running).
- Easily dedicate more or less resources to tasks.

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

[](#requirements)

- PHP7.2+
- MySQL / MariaDB

Get Started
-----------

[](#get-started)

### Install via Composer

[](#install-via-composer)

`composer require dinoqqq/crystal`

### Usage

[](#usage)

- Create a [config](CRYSTAL.md#define-the-config).
- Create a [TaskFactory](CRYSTAL.md#the-taskfactory-class), to define tasks.
- Create a [Queuer](CRYSTAL.md#the-queuer-class), to schedule processes.
- Create [cron entries](CRYSTAL.md#cron-entries) to start the system and keep it running.
- Create a [Controller](CRYSTAL.md#the-controller), to catch the cron entries and start the heartbeat processes.

Development: running tests
--------------------------

[](#development-running-tests)

To get the tests running follow these steps:

1. Set the database settings in `/config/database.php`
2. Run the migrations in `/migration`
3. Run `composer update`
4. Run `/vendor/bin/phpunit`

### Using Docker

[](#using-docker)

A `docker-compose.yml` and `Dockerfile` are included to spin up a MySQL 8.0 instance and a PHP 8.3 CLI container for local development and tests. The schema in `/migration/schema.sql` is loaded automatically on first start.

```
docker compose up -d --build
```

MySQL is exposed on `127.0.0.1:3306` with:

- Database: `crystal`
- User / password: `crystal` / `crystal`
- Root password: `root`

Set these in `/config/database.php`. Use `mysql` as the server when running from inside the PHP container, or `127.0.0.1` when running from the host:

```
'database_name' => 'crystal',
'username'      => 'crystal',
'password'      => 'crystal',
'server'        => 'mysql', // or '127.0.0.1' from the host
```

Run composer and the test suite inside the PHP container:

```
docker compose exec php composer update
docker compose exec php vendor/bin/phpunit
```

To stop the containers: `docker compose down`. To also wipe the data volume: `docker compose down -v`.

Read the extended README [here](CRYSTAL.md).

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance71

Regular maintenance activity

Popularity28

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~71 days

Recently: every ~423 days

Total

26

Last Release

43d ago

Major Versions

v0.1.0 → v1.0.02021-07-07

v1.3.2 → v2.0.02021-09-25

v1.x-dev → v2.0.12021-09-25

v2.0.1 → v3.0.02021-09-30

PHP version history (2 changes)v0.1.0PHP &gt;=7.0 &lt;7.3

v1.0.2PHP &gt;=7.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2246538?v=4)[Dino](/maintainers/dinoqqq)[@dinoqqq](https://github.com/dinoqqq)

---

Top Contributors

[![roland-bhb](https://avatars.githubusercontent.com/u/135239096?v=4)](https://github.com/roland-bhb "roland-bhb (3 commits)")[![ropoli74](https://avatars.githubusercontent.com/u/20184556?v=4)](https://github.com/ropoli74 "ropoli74 (3 commits)")[![dinoqqq](https://avatars.githubusercontent.com/u/2246538?v=4)](https://github.com/dinoqqq "dinoqqq (2 commits)")[![G0LEM-XIV](https://avatars.githubusercontent.com/u/91133074?v=4)](https://github.com/G0LEM-XIV "G0LEM-XIV (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dinoqqq-crystal/health.svg)

```
[![Health](https://phpackages.com/badges/dinoqqq-crystal/health.svg)](https://phpackages.com/packages/dinoqqq-crystal)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[phpro/grumphp

A composer plugin that enables source code quality checks.

4.3k16.7M1.0k](/packages/phpro-grumphp)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[silverstripe/framework

The SilverStripe framework

7313.7M2.8k](/packages/silverstripe-framework)[spatie/flare-client-php

Send PHP errors to Flare

177161.5M23](/packages/spatie-flare-client-php)

PHPackages © 2026

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