dereuromark / cakephp-queue

Queue plugin for CakePHP - simple, pure PHP and without dependencies.
MIT License
307 stars 136 forks source link

Scheduler #387

Closed dereuromark closed 10 months ago

dereuromark commented 11 months ago

Add scheduler for crontab like execution of commands, especially bin/cake commands. They would be put into the queue and can be therefore executed on specific timing or every x seconds/minutes/hours etc.

Any proposals/ideas here? Basically a gui based Version of https://github.com/LordSimal/cakephp-scheduler maybe

My Main ideas would be:

Using queue allows to re-run on fail, that can be nice for flickery topics

Note: There used be sth like this dormant in 2.x code ( https://github.com/dereuromark/cakephp-queue/blob/cake2/Config/Schema/schema.php#L24 ) Maybe it can re-worked in a proper way, as the old one was a bit too close to actual queue jobs instead of cronjobs.

dereuromark commented 11 months ago

Dependency wise: We could add a QueueScheduler plugin - inkl admin backend - on top of this plugin, as separate add-on plugin.

dereuromark/cakephp-queue-scheduler requires dereuromark/cakephp-queue

Then everyone can choose to use it, or leave it out. Fully configurable to run any of the commands either inside the queue (default), or trigger even sth else maybe. Not sure what else there could be, however. Ideally each item spawns a new and separate queue job so it is clear what failed. And due to the fail it would, depending on the config, also not re-queue before this one was resolved/successful.

More ideas: If it is a command, we could try parsing the ConsoleOptionParser arguments/options and autocomplete/validate them as for user input.

We could also allow quick buttons on dashboard for certain re-usable commands that can be helpful to run once in a while.

dereuromark commented 11 months ago

POC @ https://github.com/dereuromark/cakephp-queue-scheduler