Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Guikingone/SchedulerBundle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

203 Commits

Repository files navigation

SchedulerBundleHero

A Symfony bundle built to schedule/consume repetitive tasks

Main features

  • External transports (Doctrine, Redis, etc)
  • External configuration storage (Doctrine, Redis, etc)
  • Retry / Remove / Sort policies
  • Background worker
  • Symfony/Messenger integration
  • Mercure integration
  • Fibers support

Installation

Make sure Composer is installed globally, as explained in the installation chapter of the Composer documentation.

composer require guikingone/scheduler-bundle

Quick start

If symfony/flex is not installed, manually update the config/bundles.php:

// config/bundles.php
return [
 // ...
 SchedulerBundle\SchedulerBundle::class => ['all' => true],
];

Then configure a transport in config/packages/scheduler.yaml:

# config/packages/scheduler.yaml
scheduler_bundle:
 transport:
 dsn: 'filesystem://first_in_first_out'

Finally, it's time to create a simple task:

# config/packages/scheduler.yaml
scheduler_bundle:
 transport:
 dsn: 'filesystem://first_in_first_out'
 tasks:
 foo:
 type: 'command'
 command: 'cache:clear'
 expression: '*/5 * * * *'
 description: 'A simple cache clear task'
 options:
 env: test

When a task is configured, time to execute it, two approaches can be used:

  • Adding a cron entry * * * * * cd /path-to-your-project && php bin/console scheduler:consume >> /dev/null 2>&1
  • Launching the command scheduler:consume --wait in a background command

Documentation

Contributing

Want to improve this bundle?

Contributors 9

Languages

AltStyle によって変換されたページ (->オリジナル) /