Download the PHP package huuuk/phalcon-queues without Composer

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

Advanced Queues for Phalcon PHP Framework

  1. Instalation
  2. Configuration
  3. Drivers
  4. Usage
    1. Pushing Jobs
    2. Worker
  5. Todo

Instalation

Install via Composer.

Configuration

Settings

First off all you should deside which [driver] suits you best.
Then add appropriate settings in your config.ini file.

Registering service

Usually it happens in app/config/services.php file.

Since Phalcon web and console applications has different bootstrap points, you should register queue in your console app bootstrap file too.

How to set up cli application?
You can look over official docs
Also we have an example for you.

Console command

Make QueueTask class and place it in app/tasks directory

Don't forget to include this directory in autoloader of your console app

Make sure that you done it properly

Drivers

For now we support only 3 types of drivers:

Null

It's some kind of stub. All jobs pushed to this queue will never be fired.
To use this driver set driver property to null in queue section of your config.ini file

Synchronus

All jobs pushed to this queue will be fired immediatly.
To use this driver set driver property to sync in queue section of your config.ini file

Database

All jobs pushed to this queue will be stored in database table. And will be processed by worker.
To use this driver set driver property to database, and database.table in queue section of your config.ini file

Then you need to create queue table.
Just run queue task

Or you can do it manually by executing SQL query

Usage

Pushing Jobs

You can push job to queue by following code

if you need access to DI instance, just pass it to the closure

NOTE: If you use null or sync driver, DI instance defined in your web application bootstrap file will be passed to the job.
In other cases to thw job will be passed DI instance from your caonsole app.
So it's all up to you to manage services that requires your jobs.
For example in your web app you have Mailer service

and some of your jobs uses it

So to fire job properly, you need to register the same service in your console app DI too.

As all anonymous functions, our "jobs" supports variables from the parent scope.

You can also wrap your job logic in specific class

and push instance of this class to thr queue

Sometimes you need to split your jobs into different queues, for some reasons. You can pass addition parameter to push method.

Also sometimes useful to delay job firing.

Worker

To start working on queue run

For more info run

Todo


All versions of phalcon-queues with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
jeremeamia/superclosure Version ^2.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 huuuk/phalcon-queues contains the following files

Loading the files please wait ....