Add support for subscriptions and scheduled actions in service config #19
Labels
No labels
bug
confirmed
critical
discussion
documentation
Doing
enhancement
suggestion
support
To Do
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: hazaar/hazaar-warlock#19
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Right now it is only possible to schedule actions and subscribe to events programatically. This is normally done in the service init() method. This is fine, but it means that you also have to handle the APPLICATION_ENV programatically if it is a factor. This is the case if you want to subscribe to an event in development only, to assist with development but you don't want to allow that in production.
We should be using the service config file to handle all this, that way the APPLICATION_ENV is always taken into account when loading the config and we can easily subscribe/schedule different things based on the environment.
added ~164 label
created branch
19-add-support-for-subscriptions-and-scheduled-actions-in-service-config
created branch
19-add-support-for-subscriptions-and-scheduled-actions-in-service-config
Here is an example of the supported config format:
This config should be pretty obvious. But to explain, it will subscribe to two events, do_the_thing and set_the_date. It will also schedule the following actions:
I have purposely not added support for schedules at a specific date time. This seemed like a silly thing to put in a config file as once it's executed the config is useless. Calling $this->schedule() inside a service is more likely how this will be used.
mentioned in commit
f23410ea69
mentioned in merge request !4
closed via commit
f23410ea69
closed via commit
acf76f22d0
closed via merge request !4