old_mixer_repo icon indicating copy to clipboard operation
old_mixer_repo copied to clipboard

Lazily evaluation of attributes: attributes as functions.

Open mandarjog opened this issue 7 years ago • 0 comments

Mixer attributes today are all materialized when they are defined. This is specifically the case where an attribute is the result of evaluation of a function, like in case of an attribute producing adapter.

There are certain interesting features that are possible using this approach. For example consider the following definition of request.XForwardedHost

request.XForwardedHost = DNS(request.headers["X-Forwarded-Host"])

In this case the attribute will only be evaluated when it is used in the dynamic path. If config only uses it as a string, they can continue to refer to it as request.headers["X-Forwarded-Host"]

Related to issue #1099 ,

mandarjog avatar Aug 18 '17 18:08 mandarjog