symfony-bundle bernard-scheduler-bundle
Adds scheduling to BernardPHP for symfony.
pompdelux/bernard-scheduler-bundle
Adds scheduling to BernardPHP for symfony.
- Monday, June 30, 2014
- by mrbase
- Repository
- 3 Watchers
- 0 Stars
- 3 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 1 Forks
- 0 Open issues
- 2 Versions
- 0 % Grown
BernardSchedulerBundle
This bundle brings scheduling to your BernardPHP powered Symfony2 app., (*1)
Please note that this bundle relies on redis as backend., (*2)
Install:
-
Add BernardSchedulerBundle to your dependencies:, (*3)
// composer.json
{
// ...
"require": {
// ...
"pompdelux/bernard-scheduler-bundle": "1.*"
}
}
-
Use Composer to download and install the bundle:, (*4)
$ php composer.phar update pompdelux/bernard-scheduler-bundle
-
Register the bundle in your application:, (*5)
// app/AppKernel.php
class AppKernel extends Kernel
{
// ...
public function registerBundles()
{
$bundles = array(
// ...
new Pompdelux\BernardSchedulerBundle\BernardSchedulerBundle(),
);
}
}
-
Add php_redis
section to config.yml
, (*6)
// app/config.yml
php_resque:
class:
bernard:
host: %redis_host%
port: %redis_port%
prefix: %redis_prefix%
skip_env: %redis_skip_env%
database: %redis_database%
auth: %redis_password%
Usage:
use Pompdelux\BernardSchedulerBundle\Job;
// Adds 'DoStuff' job to 'some-bernard-queue' for execution in 30 seconds.
$job = new Job('some-bernard-queue', 'DoStuff', [
'any' => 'job data',
]);
$container->get('pdl.bernard_scheduler')->enqueueIn(30, $job);