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

Create context on subscribers #41

Open
CrochetFeve0251 opened this issue Aug 28, 2024 · 0 comments
Open

Create context on subscribers #41

CrochetFeve0251 opened this issue Aug 28, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@CrochetFeve0251
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
Contexts are a great way in WP Rocket to decide whenever a callback is gonna execute or not.

Describe the solution you'd like
We would need that context into launchpad.

However, when adding them to Launchpad, we would like them to be instantiated apart from the subscriber.
That way we would be able to save save memory by just instantiating the context and bail out if without instantiating the subscriber if we don't need that logic.

Also, to simplify the logic to add a context and prevent repetitive code, we should be using annotations @context for that on the class or the method definition.

Priority should go on the method context if two contexts are registered.

Finally, for the context itself, to prevent any heavy constraints, it should just be a method or a class with php invoke method and without parameters.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@CrochetFeve0251 CrochetFeve0251 added the enhancement New feature or request label Aug 28, 2024
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

1 participant