anorgan/qutee-service-provider

QuTee Service Provider for Silex microframework

v1.0.1 2013-05-06 17:31 UTC

README

Build Status

Silex Service Provider for queue manager and task processor - QuTee.

Instalation

Qutee Service Provider is easily installed via Composer by requiring "anorgan/qutee-service-provider": "*".

{
    "require": {
        "anorgan/qutee-service-provider": "*"
    },
    "minimum-stability": "dev"
}

Usage

Register the Qutee Service Provider in Silex application, provide the configuration via qutee.config key.

<?php

// Register and configure the service provider

$app->register(new \Qutee\Silex\QuteeServiceProvider(), array(
    'qutee.config' => array(
        'persistor' => 'Redis',
        'options'   => array(
            'host'  => '127.0.0.1',
            'port'  => 6379
        )
    )
));

// Create tasks
$app['qutee.create_task'](
    'Acme/DeleteFolder',
    array('path' => '/usr'),
    \Qutee\Task::PRIORITY_HIGH
);

// Process tasks
$app['qutee.worker']
    ->setInterval(30)
    ->run();

Links