Download the PHP package quellabs/canvas-scheduler-rabbitmq without Composer

On this page you can find all versions of the php package quellabs/canvas-scheduler-rabbitmq. 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 canvas-scheduler-rabbitmq

canvas-rabbitmq

RabbitMQ queue consumer and job dispatcher for the Canvas PHP framework.

Adds a RabbitMQ-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

Installation

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

Configuration

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

This tells Canvas to inject RabbitMQQueue 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:

RabbitMQ-specific settings go in config/scheduler-rabbitmq.php:

exchange_name defaults to the empty string, which uses RabbitMQ's built-in default exchange and routes messages directly to the queue by name. Set this only if you are using a custom exchange topology.

prefetch_count controls how many unacknowledged messages each worker holds at once. The default of 1 gives the fairest work distribution when running multiple worker processes.

Creating a Job

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

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

Inject QueueInterface into any controller or service:

The job is published to RabbitMQ immediately and processed by the worker when it is next available.

Running the Worker

Start the worker via Sculpt:

The worker polls RabbitMQ for jobs until it reaches the configured queue_max_jobs limit (default: 500), then exits cleanly. Use Supervisord to keep it running:

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:

Retry and Failure Handling

Failed jobs are retried up to getMaxRetries() times. On each failure the original message is rejected and a fresh message with an incremented attempt counter is published back to the pending queue. Jobs that exhaust all retries are published to a separate failed queue for inspection.

Queue Layout

Queue Purpose
{queue_name} Pending jobs
{queue_name}.failed Failed jobs

Both queues are declared durable and messages are published as persistent, so jobs survive a RabbitMQ broker restart.

License

MIT


All versions of canvas-scheduler-rabbitmq with dependencies

PHP Build Version
Package Version
Requires php-amqplib/php-amqplib Version ^3.0
quellabs/canvas Version ^1.
quellabs/contracts Version ^1.
quellabs/dependency-injection Version ^1.
quellabs/support Version ^1.
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 quellabs/canvas-scheduler-rabbitmq contains the following files

Loading the files please wait ...