Extended global events #59

Closed
opened 2020-06-19 04:46:49 +00:00 by jamie · 4 comments
jamie commented 2020-06-19 04:46:49 +00:00 (Migrated from git.hazaar.io)

Currently, global events have to be static methods and can exist on any class. This is so that the code can be copied and executed within the application context by using a Hazaar\Warlock\Container object. The Hazaar\Warlock\Container class extends from the Hazaar\Warlock\Process class which is the class that defines all the functions used by running processes, such as trigger(), log(), etc. These types of global events are defined in configuration as ClassName::methodName.

The plan here is to allow methods that are stored in existing services to be executed as global events. These would be defined in the config as ClassName->methodName so as to not interfer with the existing functionality and still allow global event code to be stored on any application accessible class. However, defining the config like this would add an additional check that the class extends the Hazaar\Warlock\Process class when it is instantiated. This new object can then be initialised, pretty much exactly how a running Service is, then the method will be executed without the use of a container object.

Currently, global events have to be static methods and can exist on any class. This is so that the code can be copied and executed within the application context by using a `Hazaar\Warlock\Container` object. The `Hazaar\Warlock\Container` class extends from the `Hazaar\Warlock\Process` class which is the class that defines all the functions used by running processes, such as `trigger()`, `log()`, etc. These types of global events are defined in configuration as `ClassName::methodName`. The plan here is to allow methods that are stored in existing **services** to be executed as global events. These would be defined in the config as `ClassName->methodName` so as to not interfer with the existing functionality and still allow global event code to be stored on any application accessible class. However, defining the config like this would add an additional check that the class extends the `Hazaar\Warlock\Process` class when it is instantiated. This new object can then be initialised, pretty much exactly how a running Service is, then the method will be executed without the use of a container object.
jamie commented 2020-06-23 06:12:58 +00:00 (Migrated from git.hazaar.io)

mentioned in merge request !31

mentioned in merge request !31
jamie commented 2020-06-23 06:12:58 +00:00 (Migrated from git.hazaar.io)

created merge request !31 to address this issue

created merge request !31 to address this issue
jamie commented 2020-06-23 06:31:31 +00:00 (Migrated from git.hazaar.io)

closed via merge request !31

closed via merge request !31
jamie commented 2020-06-23 06:31:32 +00:00 (Migrated from git.hazaar.io)

mentioned in commit 0e24068247

mentioned in commit 0e240682472bbd61690f57c05fa0214c5b9b75c2
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: hazaar/hazaar-warlock#59
No description provided.