Skip to content

Load Rules lazyly#70

Open
melicerte wants to merge 4 commits into
biig-io:masterfrom
melicerte:master
Open

Load Rules lazyly#70
melicerte wants to merge 4 commits into
biig-io:masterfrom
melicerte:master

Conversation

@melicerte
Copy link
Copy Markdown

Use proxy manager to proxify Rules.

Rules should not be loaded with all dependent services at each start of the application.
Who knows how many services are injected by Rules ?
Instead, set each Rule as a lazy service.

BUT, the downside is that I put on and after functions as static to be able to get events without initialize the Rule object.
So it comes with less flexibility, as you cannot define complex behaviour in on and after functions.
Oh, and it breaks compatibility, obviously.

Another (better ?) idea would be to split detection and execution in 2 classes.
One Rule with on or/and after function and on Handler with one function handle which will execute what needs to be executed.
And only the Handler would be set as lazy.
BUT, the downside is that one would have to implement two classes instead of one ...

@melicerte melicerte requested a review from Nek- January 20, 2020 08:17
@melicerte
Copy link
Copy Markdown
Author

@Nek- What do you think about merging this PR ?

@Nek-
Copy link
Copy Markdown
Contributor

Nek- commented Mar 10, 2020

First we need to fix that: #73

Comment thread composer.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants