Skip to content

Latest commit

 

History

History
65 lines (52 loc) · 1.82 KB

README.md

File metadata and controls

65 lines (52 loc) · 1.82 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.