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

Use an Injector registry #9

Open
sminnee opened this issue Aug 17, 2015 · 1 comment
Open

Use an Injector registry #9

sminnee opened this issue Aug 17, 2015 · 1 comment

Comments

@sminnee
Copy link
Member

sminnee commented Aug 17, 2015

Right now, you need a separate class for each cronjob, and any class that exists will be automatically run. This is simpler, but also less flexible. For example, you can't create a class CronRunBuildTask class that takes a build task as a wrapper.

That way, you could mix and match simple CronTask implementations with configured ones:

CronTaskController:
  tasks:
    - %$SyncHourlyTask
    - %$Namesace\Class\I\Just\Want\To\Use\Without\Arguments

Injector:
  SyncHourlyTask:
    class: CronRunBuiskTask
    properties:
      Schedule: "* * * * 0"
      BuildTask: FilesystemSyncTask

If you wanted to support the old way of running all implementors of the interface, you could have a config option for that:

CronTaskController:
  tasks: [ "*" ]
@robbieaverill
Copy link
Contributor

This would let us move away from "magic" lookups towards explicit configuration, which would be in keeping with other parts of core. +1 from me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants