Download the PHP package bricev/jobqueue without Composer

On this page you can find all versions of the php package bricev/jobqueue. 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 jobqueue

PHP JobQueue component

Scrutinizer Code Quality Code Coverage Build Status

Simple Job/Queue PHP component to help applications distribute Tasks through multiple workers.

Install

This package is installable and auto-loadable via Composer:

The application proposes a webservice and two CLIs. Read bellow for more documentation.

Configuration

Usage

Defining a job

A job holds the code that will be executed for tasks by a worker.

Each job must be defined in a PHP class that implements the ExecutableJob interface:

Note: ExecutableJob interface extends the LoggerAwareInterface that can be used to set a logger. This documentation provides more information about PSR-3 Log interfaces.

Tip: Package psr/log (repo) can be added to a composer project by running this command:

The \Psr\Log\LoggerAwareTrait can be used to easily add a logger setter and be compliant with the LoggerAwareInterface.

Defining a task

Creating a task requires the following elements:

To define a task in PHP:

Adding tasks to the queue

First, the queue has to be instantiated.

This can be done manually:

Or by using the ServiceContainer (this requires the proper configuration, see Configuration section above):

Then, tasks can be enqueued easily:

The task's job will be executed as soon as a worker starts consuming the task's profile. This component embeds a PHP executable worker. See the CLI section to get more details about its usage.

Worker events

The worker emits some events that can be listened to:

Event name Description Event attributes
worker.start Fired on worker launch $event->getWorker()
worker.finished Fired once the worker has finished running $event->getWorker()
task.fetched Fired each time a task is fetched from queue by the worker $event->getTask()
task.executed Fired when a task's job execution has been successful done $event->getTask()
task.failed Fired when a task's job execution fails $event->getTask()

To intercept an event, you can use the EventDispatcher from the service container:

CLI

Those features require the proper configuration, see Configuration section above.

The manager app can be used to perform CRUD operations on tasks.

Usage:

The worker app can be used to consume enqueued tasks.

Usage:

The worker app can be used as an OS service (eg. upstart, systemd... on unix) to run on servers.

Webservice

Configuration

A web server should be configured to serve public/index.php as a router script. This feature requires the proper configuration, see Configuration section above.

API

List all tasks:

Returns an array of tasks:

Errors:

Get a task information:

Returns the task definition:

Errors:

Create a new task:

Returns the task definition:

Errors:

Tests

First, a Redis server must run locally (127.0.0.1 on 6379 port).

Then, to run tests, use the following command:

The MIT License (MIT). Please see LICENSE for more information.


All versions of jobqueue with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1
http-interop/response-sender Version ^1.0
middlewares/error-handler Version ^1.0
middlewares/fast-route Version ^1.0
middlewares/payload Version ^1.0
middlewares/request-handler Version ^1.0
predis/predis Version ^1.0
psr/log Version ^1.0
ramsey/uuid Version ^3.0
relay/relay Version ^2.0
symfony/config Version ^4.0
symfony/console Version ^4.0
symfony/dependency-injection Version ^4.0
symfony/event-dispatcher Version ^4.0
symfony/yaml Version ^4.0
vlucas/phpdotenv Version ^2.0
zendframework/zend-diactoros Version ^1.0
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 bricev/jobqueue contains the following files

Loading the files please wait ....