orisai / nette-scheduler
Orisai Scheduler integration for Nette
Installs: 10 304
Dependents: 2
Suggesters: 0
Security: 0
Stars: 6
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: 7.4 - 8.3
- nette/di: ^3.0.5
- nette/schema: ^1.1.0
- orisai/cron-expression-explainer: ^1.0.0
- orisai/exceptions: ^1.0.0
- orisai/nette-di: ^1.0.7
- orisai/scheduler: ^1.0.0|^2.0.0
Requires (Dev)
- brianium/paratest: ^6.3.0
- infection/infection: ^0.26.0|^0.27.0|^0.28.0|^0.29.0
- orisai/coding-standard: ^3.0.0
- orisai/nette-console: ^1.2.0
- phpstan/extension-installer: ^1.0.0
- phpstan/phpstan: ^1.0.0
- phpstan/phpstan-deprecation-rules: ^1.0.0
- phpstan/phpstan-nette: ^1.2.0
- phpstan/phpstan-phpunit: ^1.0.0
- phpstan/phpstan-strict-rules: ^1.0.0
- phpunit/phpunit: ^9.5.0
- staabm/annotate-pull-request-from-checkstyle: ^1.7.0
- tracy/tracy: ^2.7.0
README
Nette Scheduler
Orisai Scheduler integration for Nette
📄 Check out our documentation.
💸 If you like Orisai, please make a donation. Thank you!
Register scheduler extension
extensions: orisai.scheduler: OriNette\Scheduler\DI\SchedulerExtension
Create service which will be run as a job
namespace Example; class ExampleJobService { public function run(): void { // Do something } }
orisai.scheduler: jobs: - expression: * * * * * callback: [@example.job.service, 'run'] services: example.job.service: Example\ExampleJobService
Create script with scheduler setup (e.g. bin/scheduler.php
)
use Orisai\Scheduler\Scheduler; require __DIR__ . '/../vendor/autoload.php'; $configurator = Bootstrap::boot(); $container = $configurator->createContainer(); $scheduler = $container->getByType(Scheduler::class); $scheduler->run();
Configure crontab to run your script each minute
* * * * * cd path/to/project && php bin/scheduler.php >> /dev/null 2>&1
Looking for more? Documentation is here.