spiral / app

Spiral Framework Skeleton HTTP Application: Queue, Console, Cycle ORM
https://spiral.dev/
MIT License
194 stars 21 forks source link

More advanced scheduler #130

Open DawidJur opened 1 year ago

DawidJur commented 1 year ago

Currently scheduler https://spiral.dev/docs/advanced-scheduler/3.7/en can be explained as "cron-builder". What I mean by that is it's mainly used to be converted to crontab config. It is pretty limiting, since cron is almost 50 years of piece of technology and doesn't allow to create tasks starting more frequently than every minute - I had use cases where I wanted to start my command every second.

We have schedule:work command, which is simulating cron behavior. I think we could rewrite this module:

  1. Leave/modify current version to be "cron builder" since current version is basically that.
  2. Create new version that is not limited by cron, allow for more advanced configuration and integrations with Roadrunner/Supervizord if that's needed.

The schedule php process could be started by RR with application warmup when any schedule is active. Features like starting command every second should be a thing.