PHPackages                             buzzingpixel/corbomite-queue - 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. buzzingpixel/corbomite-queue

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

buzzingpixel/corbomite-queue
============================

Corbomite queue

1.4.1(7y ago)02221PHPPHP &gt;=7.1

Since Jan 10Pushed 7y ago1 watchersCompare

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

READMEChangelog (7)Dependencies (13)Versions (9)Used By (1)

Corbomite Queue
===============

[](#corbomite-queue)

[![](https://camo.githubusercontent.com/d90d417e68257bdc6be745ab258d06d4959d98c7eee805c2e9de1c787b5c7aa9/68747470733a2f2f7472617669732d63692e6f72672f62757a7a696e67706978656c2f636f72626f6d6974652d71756575652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/buzzingpixel/corbomite-queue)

Part of BuzzingPixel's Corbomite project.

This project provides a Queue for adding items to be run by the server in sequence.

Usage
-----

[](#usage)

When you require this into a Corbomite project, the CLI commands and dependency injection config will automatically be set up.

### Installation

[](#installation)

Corbomite Queue needs to add a couple of database tables in order to function. In order to do this, it needs to create some migrations which then need to be run. Run the create-migrations command, which will place migration files in your Corobomite project.

```
php app queue/create-migrations
```

After running that command, you'll need to run the migrations:

```
php app migrate/up
```

### Running the queue

[](#running-the-queue)

#### Development environment

[](#development-environment)

In dev, you'll probably just want to run the queue manually. The command to do that is:

```
php app queue/run
```

That command runs the next item in your queue.

#### Production Environments

[](#production-environments)

As of 1.3.0, Corbomite Queue is multiple worker aware. That means you can and should have multiple workers running the queue/run command in a loop (how many workers will depend on how beefy your server environment is and how many resources you want consumed on the queue). The queue tracks which batches are running and which are not running. The next worker will pick up the next task in a batch that does not currently indicate it is running.

An example shell script is provided in this repository for Linux environments. [Example Shell Script](queueRunnerExampleScript.sh%60).

You are encouraged to use Supervisor to set multiple workers to run this script.

### Adding to the queue

[](#adding-to-the-queue)

The Queue API is provided to make things extremely easy to add items to the queue. Note that in the examples below, any class you specify to add to the queue, Corbomite Queue will attempt to get it from the Dependency Injector first so you can use dependency injection if you want to.

```
