guikingone / scheduler-bundle
A Symfony bundle that allows to schedule and create repetitive tasks
Installs: 196 030
Dependents: 0
Suggesters: 0
Security: 0
Stars: 111
Watchers: 4
Forks: 10
Open Issues: 31
Type:symfony-bundle
Requires
- php: >=8.0
- ext-json: *
- dragonmantank/cron-expression: ^3.1
- psr/log: ^1.0 || ^2.0 || ^3.0
- symfony/config: ^5.4 || ^6.0 || ^7.0
- symfony/console: ^5.4 || ^6.0 || ^7.0
- symfony/event-dispatcher: ^5.4 || ^6.0 || ^7.0
- symfony/filesystem: ^5.4 || ^6.0 || ^7.0
- symfony/finder: ^5.4 || ^6.0 || ^7.0
- symfony/lock: ^5.4 || ^6.0 || ^7.0
- symfony/options-resolver: ^5.4 || ^6.0 || ^7.0
- symfony/process: ^5.4 || ^6.0 || ^7.0
- symfony/property-access: ^5.4 || ^6.0 || ^7.0
- symfony/serializer: ^5.4 || ^6.0 || ^7.0
- symfony/stopwatch: ^5.4 || ^6.0 || ^7.0
Requires (Dev)
- ext-pcntl: *
- ext-pdo: *
- ext-redis: *
- doctrine/dbal: ^3.3.6
- doctrine/orm: ^2.8
- friendsofphp/php-cs-fixer: ^3.13
- infection/infection: ^0.26.16
- marcocesarato/php-conventional-changelog: ^1.14
- phpdocumentor/reflection-docblock: ^5.3
- phpstan/phpstan: ^1.9.8
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-doctrine: ^1.3.31
- phpstan/phpstan-phpunit: ^1.3.3
- phpstan/phpstan-strict-rules: ^1.4.4
- phpstan/phpstan-symfony: ^1.2.19
- phpunit/phpunit: ^9.5.26
- psr/cache: ^1.0 || ^2.0 || ^3.0
- rector/rector: 0.15.10
- symfony/cache: ^5.4 || ^6.0 || ^7.0
- symfony/dependency-injection: ^5.4 || ^6.0 || ^7.0
- symfony/error-handler: ^5.4 || ^6.0 || ^7.0
- symfony/framework-bundle: ^5.4 || ^6.0 || ^7.0
- symfony/http-client: ^5.4 || ^6.0 || ^7.0
- symfony/http-kernel: ~5.4.20 || ~6.0.20 || ~6.1.12 || ~6.2.6 || ^6.3.0 || ^7.0
- symfony/mercure: ^0.5.3
- symfony/messenger: ^5.4 || ^6.0 || ^7.0
- symfony/notifier: ^5.4 || ^6.0 || ^7.0
- symfony/rate-limiter: ^5.4 || ^6.0 || ^7.0
Suggests
- symfony/http-client: For dispatching http tasks and / or using external probe clients
- symfony/messenger: For dispatching tasks to queue
- symfony/notifier: For dispatching notification tasks
- dev-main
- 0.10.4
- 0.10.3
- 0.10.2
- 0.10.1
- 0.10.0
- 0.9.4
- 0.9.3
- 0.9.2
- 0.9.1
- 0.9.0
- 0.8.1
- 0.8.0
- 0.7.1
- 0.7.0
- 0.6.2
- 0.6.1
- 0.6.0
- 0.5.5
- 0.5.4
- 0.5.3
- 0.5.2
- 0.5.1
- 0.5.0
- 0.4.9
- 0.4.8
- 0.4.7
- 0.4.6
- 0.4.5
- 0.4.4
- 0.4.3
- 0.4.2
- 0.4.1
- 0.4.0
- 0.3.4
- 0.3.3
- 0.3.2
- 0.3.1
- 0.3.0
- 0.2.0
- 0.1.0
- dev-changelog/0.10.4
- dev-tools/phpstan
- dev-feat/psr_clock
- dev-issue/51
- dev-issue/289
- dev-refactor/static_analysis_phpstan_90
- dev-build/extensions
- dev-issue/task_lock
- dev-feat/grpc
- dev-build/8.1
- dev-feat/heartbeat_worker
- dev-issue/133
- dev-issue/58_pool
- dev-issue/231
- dev-feat/apip
- dev-issue/200
- dev-issue/triggers
- dev-issue/147
This package is auto-updated.
Last update: 2024-10-31 00:23:26 UTC
README
Daily runs
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
- Usage
- Configuration
- Best practices
- Tasks
- Transports
- Lock
- Commands
- Events
- Lazy Loading
- Messenger
- HTTP entrypoint
- ExecutionPolicies
- SchedulePolicies
- Runners
- Worker
- Scheduler
- Middleware
- Probe
- Tests
- Mercure
Contributing
Want to improve this bundle?