-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Set Enabled in StaticHelper to afect all instances #129
base: master
Are you sure you want to change the base?
Conversation
I am not sure how the changes accomplish the stated goal, could you maybe provide some code samples to show the difference in use between the current code, and the code you are proposing? |
Sure, so right now we have two ways of starting an Experiment, either by using the Static helper like My changes allow the Enabled to affect all of the esperiments regardless if they are being create using the static helper or the instance |
One change that could be helpful in evaluating this would be to revert the naming change of Do you think you could write a test that will only pass with this change? |
Yeah sure, I'll write the test and update the PR. Will revert the name change also |
Thank you! |
I do have a few more ideas to make it more IoC friendly, but I wanna do them in a different PR. |
@M-Zuber did you had time to review the latest changes? |
Allows to define the Enabled function without having to create a special implementation for when not using the helper.
Background for this PR. Having a few experiments running without using the Static Helper, was trying to disable all experiments at once, by using the Enabled method. Turns out it wasn't possible.
To achieve this Had to create a implementation of Scientist and override the IsEnabledAsync.
This PR aims to allow the set of the Enabled func globally, for experiments using the helper and for the implementations.
The IsEnabledAsync remains virtual so that we can still override the enabled behaviour for a specific one