Comment 5 for bug 631884

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 631884] Re: multiple variables pointing to FeatureController get out of sync easily

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.