understeam / yii2-command-scheduler
Yii2 extenstion for Command Bus commands scheduling
Installs: 131
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 0
Open Issues: 0
Type:extension
This package is not auto-updated.
Last update: 2024-11-05 22:26:08 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.