understeam / yii2-command-scheduler
Yii2 extenstion for Command Bus commands scheduling
Package info
github.com/Understeam/yii2-command-scheduler
Type:extension
pkg:composer/understeam/yii2-command-scheduler
Requires
- mtdowling/cron-expression: ^1.1
- yiisoft/yii2: ^2.0
Requires (Dev)
Suggests
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2025-07-30 02:24:38 UTC
README
This command is alternative for cron and any other cron scheduling components.
It allows to schedule any task dynamically from code:
Yii::$app->scheduler->add( 'my-unique-command-key', // Unique task key. If task already exists it will be replaced $command, // Command. May be literally anything. See Executor section '0 0 * * *', // Cron expression false // Repeat after success execution? Default - true );
This lightweight operation allows to postpone any heavy tasks into background.
This tool is cron based, so, you need to run a scheduler script every minute.
Example entry of crontab file:
* * * * * /usr/bin/php /var/www/my-application/yii scheduler/cron --interactive=false
Executor
TODO
Command
TODO
Sorry about docs, they are not ready yet. You can inspect tests and code to see how it works, it's quite simple.