Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extending Tasks #34

Open
MGatner opened this issue Nov 1, 2021 · 2 comments
Open

Extending Tasks #34

MGatner opened this issue Nov 1, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@MGatner
Copy link
Member

MGatner commented Nov 1, 2021

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.

@lonnieezell lonnieezell added the enhancement New feature or request label Nov 10, 2021
@lonnieezell
Copy link
Member

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.

@MGatner
Copy link
Member Author

MGatner commented May 28, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants