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

Disabling callbacks based on Expression language #21

Open
tristanbes opened this issue Mar 16, 2016 · 4 comments
Open

Disabling callbacks based on Expression language #21

tristanbes opened this issue Mar 16, 2016 · 4 comments

Comments

@tristanbes
Copy link

Hello,

Right now we can disable a callback via enabled: false.
Wouldn't be awesome if we could put Expressions using the ExpressionEngine instead of a boolean ?

Use case: feature flags
This way we could enable/disable callbacks with business logic instead of adding the logic itself inside the callback code wenever possible.

callbacks:
    my_callback:
        ...
        enabled: "object.getSettings().hasFeature('email_enabled')"
@winzou
Copy link
Owner

winzou commented Mar 17, 2016

Hello,

I'm not a big fan of putting too much business logic in config files. But I see an interesting use case for dynamically disable a third-party callback, instead of writing a new callback with a if to call the third-party callback.

You can already use container parameters in the disabled key, why is that not enough?

@tristanbes
Copy link
Author

Because we have multi-tenant application (for example X shops running on the same database and codebase). So each X stores has different configuration/features that are not dumped into the container

@pjedrzejewski
Copy link

@winzou Would you merge such feature if we open a PR? :)

@winzou
Copy link
Owner

winzou commented Jun 28, 2016

@pjedrzejewski Definitely, that's a really interesting feature actually. Should not be complicated to implement.

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

No branches or pull requests

3 participants