Download the PHP package phelixjuma/php-enqueue without Composer

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

PHELIXJUMA PHP-ENQUEUE

This is a simple but robust implementation of redis-based job queues in PHP.

Why another job queue package? Well, I tried all the top ones I could find but none just fit fine: some of the top suggested options haven't been maintained in over 5 years and their dependencies caused a lot of conflicts with my other packages, so I built a new package, for me.

The backend for this package is redis.

Requirements

Installation

USAGE

1.Running the Worker

php-enqueue is event driven. Jobs are dispatched and get scheduled in redis. A worker has to be set up to run "forever". This worker listens for any incoming job and executes it. Job execution is done concurrently using amphp/parallel package which allows for several jobs to be executed concurrently

To set up a worker, run the command below:

Note that the worker takes parameters such us:

  1. queue: The name of the queue the worker listens to. Each worker can only listen to a single queue. This allows you to have multiple workers handling different queues which introduces a level of parallelization in your job execution
  2. threaded: Value of 1 means the jobs will be run in multi-threaded manner (non blocking). 0 means the jobs are run in a blocking manner. Use multi-threaded if your jobs do not depend on any global variables, otherwise, set it to 0 (blocking execution)
  3. concurrency: Defines the number of concurrent jobs a single worker can handle at a given time
  4. max_retries: If a job fails, typically by throwing an exception, it will be retried to a max number of times defined here. By default, no retry is done
  5. log_path: The path to the directory where logs should be put. Specify a directory path not a log file and ensure php has permissions to write to that directory
  6. log_level: As per the monolog log levels

NB:

  1. You can use a service like supervisord to run the workers and to watch them so that, if the worker itself fails, it can be automatically restarted.
  2. When you update your codebase on any part the workers rely on, it is good to note that the updates will not reflect unless the worker is restarted

2. Manage Jobs

You have options to manage tasks in the command line.

2.1 View list of jobs

2.2 Add new Job

2.3 Remove a job from queue

2.4 List failed jobs

2.5 Requeue failed jobs

2.6 Remove all failed jobs

3. Jobs

Every job class implement JobInterface. The classes to define are:

3.1 Sample Job Class

3.2 Script to schedule the job

NB: A better approach would be to have an enqueue service that wraps php-enqueue. In this service, you define the redis and queue so they are reusabe. An example of such a service is as shown below

4. A note On Jobs

Credits


All versions of php-enqueue with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
ext-json Version *
ext-pcntl Version *
vlucas/phpdotenv Version ^5.3
predis/predis Version ^1.1
psr/log Version ^2.0
monolog/monolog Version ^3.4
doctrine/annotations Version ^2.0
pda/pheanstalk Version ^5.0
symfony/console Version ^6.0
webmozart/assert Version ^1.11
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 phelixjuma/php-enqueue contains the following files

Loading the files please wait ....