Download the PHP package zwilias/qman without Composer

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

QMan

An evented beanstalkd queue manager.

Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version Total Downloads SensioLabsInsight

Core features

Requirements

Use case

QMan is optimized for multiple beanstalkd instances and a pool of workers listening to all of those.

HTML View on Gliffy

Examples

Queueing a closure

Queueing a closure is quite possibly the easiest thing

Essentially, this is equivalent to the following:

Working the queue

Starting a worker with all the defaults injected, is easy:

The WorkerBuilder ensures the QMan\Worker is setup with all of its required dependencies and configuration.

Queueing custom commands

The ClosureCommand, while convenient, comes with two major downsides:

As such, you'll quickly be writing custom commands on a regular basis.

A command should implement QMan\CommandInterface, which is easily done through extending QMan\AbstractCommand:

The getType() function should return a string which can be uniquely mapped to the class you want to execute. This indirection is required in order to safely handle picking up stuff like renamed classes through a simple restart of the worker.

In order for the QMan worker to pick up and execute your command, you'll need to make sure the instance of CommandSerializerInterface will pick it up. QMan comes with a generic implementation of this interface, aptly named GenericCommandSerializer. Let's make sure the class we created above is properly registered:

You could easily futureproof your application by gathering this type <-> class mapping, and representing the types as constants:

QMan's GenericCommandSerializer comes with a registerCommandTypes($map) function which can handle exactly the case described above.

Configuration

Each Worker receives an instance of QManConfig. The following properties are currently included:

Property Default Description
maxMemoryUsage 20MB As soon as your memory usage goes over maxMemoryUsage, the worker is killed.
maxTimeAlive 24h Your worker will be killed after maxTimeAlive passes. Workers are expected to be run in something like supervisord so they can be automatically restarted.
terminationSignals [SIGTERM] Upon receiving this signal - while idle - the worker will gracefully shut down. If the signal is sent while a job is being processed, handling the signal will be postponed until the job is fully processed.
maxTries 3  The maximal number of times a job can be executed resulting in failure before the job is buried. (1)
defaultFailureDelay 60s Every time a job fails, it is released again, with a certain delay. The first time it is released, the delay will be defaultFailureDelay. The second time, it will be twice that, etc. (1)

(1): Assuming you're using the default GenericJobFailureStrategy. Implementing a custom strategy for handling failed jobs is, of course, perfectly possible.

Changing configuration is as simple as instantiating QManConfig, setting your configuration preferences and passing it to the CommandBuilder:

Handling failed jobs

By default, qMan will employ a very simple strategy when handling failed jobs:

Overriding this behavior can be done easily by implementing JobFailureStrategyInterface (which extends both PSR-3's LoggerAwareInterface and qMan's ConfigAwareInterface.

Contributing

Pull requests are appreciated. Make sure code-quality (according to scrutinizer) doesn't suffer too badly and all code is thoroughly unit-tested.

Running the tests locally:

License

Copyright (c) 2015 Ilias Van Peer

Released under the MIT License, see the enclosed LICENSE file.


All versions of qman with dependencies

PHP Build Version
Package Version
Requires zwilias/beanie Version ~0.1
jeremeamia/superclosure Version ^2.1
psr/log Version ^1.0
php Version >=5.5.0
ext-ev Version ^0.2
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 zwilias/qman contains the following files

Loading the files please wait ....