The thread local is undesirable in general, because we want
(eventually) to have a single point of control to move the context of
some code from thread to thread, or (more likely) to suspend/resume
it.
The security framework and other parts of Zope require a participation
to work at all; I think getFeatureFlag as a magic convenience helper
should be tied into that same thing (which is a long winded way of
saying 'hanging off the request is appropriate').
Code that needs features without a 'request' context should just
create a scope and controller *itself* - its by far and away the
exceptional case, and given the design:
- heavy caching
- user-specific rules
we would run a high risk of surprising behaviour if we tie a
controller to any lifetime other than that of a user participation.
The thread local is undesirable in general, because we want
(eventually) to have a single point of control to move the context of
some code from thread to thread, or (more likely) to suspend/resume
it.
The security framework and other parts of Zope require a participation
to work at all; I think getFeatureFlag as a magic convenience helper
should be tied into that same thing (which is a long winded way of
saying 'hanging off the request is appropriate').
Code that needs features without a 'request' context should just
create a scope and controller *itself* - its by far and away the
exceptional case, and given the design:
- heavy caching
- user-specific rules
we would run a high risk of surprising behaviour if we tie a
controller to any lifetime other than that of a user participation.