SyliusSchedulerCommandPlugin icon indicating copy to clipboard operation
SyliusSchedulerCommandPlugin copied to clipboard

[Feature] Using the Symfony Scheduler

Open JoppeDC opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe. No

Describe the solution you'd like With the stable release of the Symfony Scheduler (exp. since 6.3) component right around the corner, we should keep into account that soon we will be able to use that to handle scheduling and handling of commands.

Therefore, it might be wise to already start thinking about this, when changing or adding current features to this project. I think the Scheduler component will be able to remove a lot of code from this repo, and therefore would be the clear better choice in the future.

As a quick example, the logic used to check if a command should be scheduled to run, and when, can be condensed into this single line:

(new Schedule())->add(RecurringMessage::cron($command->getCronExpression(), new CommandMessage($command)));

If you would like any help on making this happen, let me know, and i'd love to help out with the transition

JoppeDC avatar Oct 13 '23 14:10 JoppeDC

Hello @JoppeDC ,

Thanks for this issue, i think it can be a good thing. I think it would be a good idea to let the user choose between using the current system (based on a Command launched by a Cron) and using the Symfony Scheduler (based on Symfony Messenger). What do you think?

If you'd like to do a PR, we'd be delighted to integrate it once it's finished.

oallain avatar Oct 17 '23 14:10 oallain

Hello @JoppeDC ,

Symfony 7 is now release. Do you want to work on this feature or do you prefer I work on? Thanks

oallain avatar Dec 06 '23 07:12 oallain