PHPackages                             quellabs/canvas-scheduler-redis - 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. quellabs/canvas-scheduler-redis

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

quellabs/canvas-scheduler-redis
===============================

Redis queue consumer and job dispatcher for the Canvas PHP framework

1.0.4(1mo ago)00MITPHP

Since May 26Pushed 1mo agoCompare

[ Source](https://github.com/quellabs/canvas-scheduler-redis)[ Packagist](https://packagist.org/packages/quellabs/canvas-scheduler-redis)[ Docs](https://github.com/quellabs/canvas-redis)[ RSS](/packages/quellabs-canvas-scheduler-redis/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (5)Versions (6)Used By (0)

canvas-redis
============

[](#canvas-redis)

Redis queue consumer and job dispatcher for the [Canvas PHP framework](https://canvasphp.com).

Adds a Redis-backed job queue to Canvas's Task Scheduler system. Jobs are dispatched from application code via dependency injection and processed by a long-running worker process.

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

[](#requirements)

- PHP 8.2+
- Canvas 1.x
- Redis server
- [Predis](https://github.com/predis/predis) (installed automatically)

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

[](#installation)

```
composer require quellabs/canvas-scheduler-redis
```

No further configuration is required. The package registers itself automatically via Canvas's service discovery.

Configuration
-------------

[](#configuration)

Set the default queue driver in `config/app.php`:

```
return [
    'queue_driver' => 'redis',
];
```

This tells Canvas to inject `RedisQueue` by default when `QueueInterface` is requested. If you only have one queue package installed, this can be omitted.

To request a specific driver regardless of the default, use contextual DI:

```
$queue = $container->for('redis')->get(QueueInterface::class);
```

Redis-specific settings go in `config/scheduler-redis.php`:

```
return [
    'scheme'         => 'tcp',
    'host'           => '127.0.0.1',
    'port'           => 6379,
    'queue_name'     => 'default',
    'queue_prefix'   => 'canvas',
    'queue_max_jobs' => 500,
    'queue_timeout'  => 5,
];
```

Creating a Job
--------------

[](#creating-a-job)

Implement `QueueableInterface` on any class. Constructor parameters become the serializable payload:

```
use Quellabs\Contracts\Scheduler\QueueableInterface;

class SendEmailJob implements QueueableInterface {

    public function __construct(
        private int    $userId,
        private string $template
    ) {}

    public function handle(): void {
        // Send the email
    }

    public function getPayload(): array {
        return [
            'userId'   => $this->userId,
            'template' => $this->template,
        ];
    }

    public function getTimeout(): int {
        return 30;
    }

    public function getMaxRetries(): int {
        return 3;
    }
}
```

Payload keys must match constructor parameter names exactly — the worker reconstructs the job via Canvas's DI container using `make($class, $payload)`.

`getTimeout()` returns the maximum number of seconds the job is expected to run. This value is stored in the job envelope for observability but is not enforced by the worker itself. To enforce it, set `stopwaitsecs` in your Supervisord configuration to the longest expected job duration across all job types (see below).

Dispatching Jobs
----------------

[](#dispatching-jobs)

Inject `QueueInterface` into any controller or service:

```
use Quellabs\Contracts\Scheduler\QueueInterface;

class UserController {

    public function __construct(private QueueInterface $queue) {}

    public function register(Request $request): Response {
        // Handle registration...

        $this->queue->push(new SendEmailJob(
            userId: $user->id,
            template: 'welcome'
        ));

        return new Response('Registered');
    }
}
```

The job is pushed onto the Redis list immediately and processed by the worker when it is next available.

Running the Worker
------------------

[](#running-the-worker)

Start the worker via Sculpt:

```
./vendor/bin/sculpt schedule:run --consumer=redis
```

The worker processes jobs until it reaches the configured `queue_max_jobs` limit (default: 500), then exits cleanly. Use [Supervisord](http://supervisord.org/) to keep it running:

```
[program:canvas-worker]
command = php /path/to/your/project/vendor/bin/sculpt schedule:run --consumer=redis
directory = /path/to/your/project
autostart = true
autorestart = true
numprocs = 2
user = www-data
stdout_logfile = /var/log/canvas-worker.log
stderr_logfile = /var/log/canvas-worker-error.log
stopwaitsecs = 60
```

`stopwaitsecs` should be set to the longest expected job duration across all job types. Supervisord will send `SIGKILL`to any worker that has not stopped within this window after receiving `SIGTERM`.

Restart workers after deployment so they pick up new code:

```
supervisorctl restart canvas-worker:*
```

Retry and Failure Handling
--------------------------

[](#retry-and-failure-handling)

Failed jobs are retried up to `getMaxRetries()` times. Each retry increments the attempt counter and requeues the job. Jobs that exhaust all retries are moved to a failed list in Redis at `{prefix}:failed:{name}`, for example:

```
canvas:failed:default

```

Redis Key Layout
----------------

[](#redis-key-layout)

KeyPurpose`{prefix}:queue:{name}`Pending jobs`{prefix}:failed:{name}`Failed jobs`{prefix}:reserved:{name}:{id}`Currently executing jobLicense
-------

[](#license)

MIT

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance90

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

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

Total

5

Last Release

52d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/57e4ab872b3e37536367f2d26b192df3d3bb6a6a1cebec9a104d14a6d2ffe157?d=identicon)[noescom](/maintainers/noescom)

---

Tags

asyncjob queuecanvas-frameworkredis queue

### Embed Badge

![Health badge](/badges/quellabs-canvas-scheduler-redis/health.svg)

```
[![Health](https://phpackages.com/badges/quellabs-canvas-scheduler-redis/health.svg)](https://phpackages.com/packages/quellabs-canvas-scheduler-redis)
```

PHPackages © 2026

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