[Dancer-users] Dancer - new suggestion - "route namespace"

David Precious davidp at preshweb.co.uk
Wed Nov 23 12:26:50 CET 2011


On Wednesday 23 November 2011 11:03:05 Perlover wrote:
> Good day!
> 
> > Firstly, multi-app support is going to be a *lot* better and cleaner in
> > Dancer2, so I doubt we want to do any really major overhauling of Dancer
> > for this, we'd be better off just getting Dancer2 ready for primetime :)
> 
> I cannot use Dancer2
> I need use a stable version of Dancer for my projects

Sorry, I wasn't suggesting using Dancer2 right yet, it's not yet fully 
complete; I meant that we should focus on getting Dancer2 to the point where 
it is stable, backwards compatible and ready for use, as it has been 
redesigned from the ground up to provide better separation between apps, 
proper scoping etc.


> > At a quick glance, it sounds like you might have found the source of the
> > issue some people have seen using multiple apps via Apache2 / Plack,
> > where requests sometimes hit the wrong app.
> 
> Yes, but i use Starman + Dancer :-) And use nginx before for static files.

Fair enough - but multiple apps within one app.psgi file, so you're seeing the 
same kind of issue I think.

> > I'm not entirely sure this is required; I think the main fix, if it is
> > required, is to make sure that the code that looks for matching routes
> > can only ever consider routes within the app which is executing, if
> > that's where the problem is.
> 
> But this code in Dancer! Dancer's code looks for matching routes.
> I cannot fix this problem without fixing of Dancer

Sorry, what I meant when I said I wasn't sure "this" was required was the 
addition of a route namespace keyword and/or option to pass when declaring 
route handlers; that should be taken care of for you by Dancer, it should kno 
which app a route handler belongs to.

I didn't mean that the route-matching stuff shouldn't be fixed, if indeed it 
is broken, which it seems likely to be.


> As i wrote above i use Starman + Dancer too
> But i don't want use an one Dancer + Starman bundle for one virtual site
> And more - it's problem FOR ONE SITE for me

One site, but loading multiple apps via it, so you're in the same situation.

My point was that I personally haven't used Plack::Builder to assemble 
multiple apps into one.

Thanks for your efforts on this, by the way!




More information about the Dancer-users mailing list