Download the PHP package remq/remq without Composer

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

ReMQ

Build Status

Redis Message Queue (ReMQ) is a message queue built on top of the awesome Redis key-value store.

Getting ReMQ

ReMQ is published on Packagist, so you can install it using Composer.

"require": {
    "remq/remq": "version"
}

Jobs

Jobs are stored as classes. The class must have a perform method which can take a variable number of parameters.

class JobClass
{

    static function perform($param1, $param2)
    {
        echo "Ran job with {$param1} and {$param2}.";
    }

}

Queuing Jobs

Instead of creating a queue for each job, ReMQ allows multiple jobs per queue. This is for simplicity's sake, and there is no other reason behind it.

$queue = new ReMQ\Queue('name');
$queue->enqueue(JobClass, 'param1', 'param2');

Processing Jobs

To process a job, you need to create a worker for the queue.

$worker = new ReMQ\Worker('name');

You can also add additional queues to process.

$worker->addQueue('other');

You can also match queue names.

$worker->addQueue('*');
$worker->addQueue('namespaced:*');

To run the worker, you will call run, runTime, runCount, or runForever.

$worker->runTime(60); // run the worker for 60 seconds. REMQ_RUN_TIME
$worker->runCount(10); // run 10 jobs. REMQ_RUN_COUNT
$worker->runForever(); // run until the script is killed. REMQ_RUN_FOREVER
$worker->run(REMQ_RUN_TYPE, [$unit]); // default is REMQ_RUN_FOREVER

Failing Jobs

If an exception is thrown when a job is being processed, the job will be re-enqueued, and the exception rethrown.

try {
    $worker->runForever();
} Catch (Exception $e) {
    echo $e->getMessage();
}

TODO:

Redis

ReMQ is using Predis to connect with Redis. By default Predis will connect to 127.0.0.1 on port 6379. If you are running Redis on another machine, or a non-standard port, you can define that using the setRedisConfig method.

$queue->setRedisConfig(array(
    'host' => '10.0.0.1'
));

If Redis has an auth password, you will need to call the auth command before queuing or processing any jobs.

$queue->redis()->auth('your-pass');

Contributing

If you have made any changes or modifications (and passing tests) to ReMQ, please open a pull request. I would love to have it included in the official package.


All versions of remq with dependencies

PHP Build Version
Package Version
Requires predis/predis Version v0.8.0
php Version >=5.3.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 remq/remq contains the following files

Loading the files please wait ....