In the year 2015 I had the idea that symfony applications should be able to schedule and run tasks in the environment of the application itself.
After a few days of research I only found some wrapper for Gearman or other task-runner. But all of this had a one main problem, the developer is not able to schedule tasks in the future. Besides of that this task-runner all needs to run additional software which has to be managed and maintained.
The main parts of the library consist of the "TaskScheduler" and the "TaskRunner". The scheduler manages tasks and create their executions. The runner fetches the pending executions and uses so called, handlers to execute them. These handlers are simple PHP-Classes which take the workload of the execution and returns a result. An example would be a thumbnail generation task - where the workload contains the filename and the handler returns the path to the generated thumbnail.
In a symfony environment the handler is a simple service which can uses other services inside the dependency-injection container. This enhances the developer to reuse application code without any overhead.
In a real world example the runner will be called in a fixed interval (something like 5 minutes).