tasks icon indicating copy to clipboard operation
tasks copied to clipboard

Extending Tasks

Open MGatner opened this issue 3 years ago • 2 comments

Defining tasks solely in the Config file's init() method requires a single entry point for all scheduling. It might be good to offer a way to extend this to libraries and modules, so (for example) an Auth library could "register" its own tasks for periodic cleanup of spam accounts.

MGatner avatar Nov 01 '21 18:11 MGatner

I'm not opposed to this, but this would also require a new command to be able to list what all is registered so there's no surprises by installed packages.

One thing nice about the single entry point is that you always know what is scheduled.

lonnieezell avatar May 27 '22 20:05 lonnieezell

Another point to be made is resolving multiple Task configs. For example, right now a developer could create app/Config/Tasks.php with init() to supply their own task specs. But, some package could also create Foo\Bar\Config\Tasks which might get loaded by config('Tasks') before this one. Having a modular way to schedule tasks prevents accidental overlaps.

MGatner avatar May 28 '22 10:05 MGatner