pompdelux / bernard-scheduler-bundle
Adds scheduling to BernardPHP for symfony.
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 4
Forks: 1
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.5
- ext-redis: 2.2.x
- bernard/bernard-bundle: ~1.0
- pompdelux/phpredis-bundle: 1.*
This package is not auto-updated.
Last update: 2024-10-22 07:54:13 UTC
README
This bundle brings scheduling to your BernardPHP powered Symfony2 app.
Please note that this bundle relies on redis as backend.
Install:
-
Add BernardSchedulerBundle to your dependencies:
// composer.json { // ... "require": { // ... "pompdelux/bernard-scheduler-bundle": "1.*" } }
-
Use Composer to download and install the bundle:
$ php composer.phar update pompdelux/bernard-scheduler-bundle
-
Register the bundle in your application:
// app/AppKernel.php class AppKernel extends Kernel { // ... public function registerBundles() { $bundles = array( // ... new Pompdelux\BernardSchedulerBundle\BernardSchedulerBundle(), ); } }
-
Add
php_redis
section toconfig.yml
// 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);