[Dancer-users] messed up routes
Puneet Kishor
punk.kish at gmail.com
Thu Oct 20 22:57:31 CEST 2011
On Oct 20, 2011, at 2:50 PM, Richard Huxton wrote:
> On 20/10/11 20:05, Puneet Kishor wrote:
>>
>> On Oct 20, 2011, at 1:40 PM, Richard Huxton wrote:
>>
>>>> In fact, think this through -- if the above is really true, then once
>>>> the non-default layout has been set (say, 'main_presentation') then
>>>> the default 'main' layout should never be set for anyone because I
>>>> wasn't explicitly setting the main layout. But, that wasn't the case
>>>> as well.
>>>
>>> Well, it'll be set if that backend hasn't changed it yet, because that's what it defaults to (I assume). But, if you've only got one backend then you're correct.
>>
>> Just one backend. All my apps are with Starman serving on http://127.0.0.1:<port> proxied behind Apache VirtualHost front ends.
>
> Sorry - we're using different terminology. Starman has a --workers option which you usually set to something greater than 1. Each one will have its own settings (including the "layout" setting). Each request can go to a different worker. So you can end up with:
> request 1: login page - worker 1 - sets layout = nomenu
> request 2: home page - worker 2 - sets layout = menu
> request 3: news page - worker 1 - will start with layout=nomenu
>
> Now, if request 3 had gone to worker 2 you would have had a default layout of "menu" instead. I think this is what you are seeing, you can see how if you've got 10 workers the situation can get confusing.
>
This is brilliant information. I never made this connection. Thanks a ton for this as this will allow me to be more careful with the way I code my apps. I guess the main thing is to be as specific as possible vis a vis routes and templates.
--
Puneet Kishor
More information about the Dancer-users
mailing list