-
Notifications
You must be signed in to change notification settings - Fork 9
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
Share condition registry & context among threads. #13
Conversation
QADependencies have changed, so fire up a virtualenv and run
|
@@ -33,7 +37,7 @@ def nested_config(config): | |||
return cfg | |||
|
|||
|
|||
def configure(config={}, nested=False): | |||
def configure(config={}, nested=False, request=None, user=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The user parameter looks unused and untested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, honestly, this (passing user and request into configure) is a hack right now, until I can code up a more robust API for defining a context (i.e. the data that a switch has to work with to determine if it should be active). Internally, user (assigned to context['user']
) is only used when versioning a switch. Externally, it can be used (as we do) by custom conditions to turn switches on/off for certain users, groups, permissions, etc.
👍 |
👍 Will QA |
QA OK! |
Not part of this branch but it would be nice if the action icons beside the switch names were bigger with some padding between them. |
Share condition registry & context among threads.
Turns out some things need to be shared among the threads. To avoid race conditions, these variables should only be populated at server startup; after that, they should be read-only.