Skip to content

Latest commit

 

History

History
53 lines (40 loc) · 1.88 KB

README.md

File metadata and controls

53 lines (40 loc) · 1.88 KB

Orisai
Scheduler

Cron job scheduler - with locks, parallelism and more

📄 Check out our documentation.

💸 If you like Orisai, please make a donation. Thank you!

Create script with scheduler setup (e.g. bin/scheduler.php)

use Cron\CronExpression;
use Orisai\Scheduler\SimpleScheduler;

$scheduler = new SimpleScheduler();

// Add jobs
$scheduler->addJob(
	new CallbackJob(fn() => exampleTask()),
	new CronExpression('* * * * *'),
);

$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.