[Catalyst] Re: How to redirect before some code excute

Wade.Stuart at fallon.com Wade.Stuart at fallon.com
Thu Oct 26 17:04:46 GMT 2006





]

"Carl Franks" <fireartist at gmail.com> wrote on 10/26/2006 10:15:18 AM:

> On 26/10/06, leonard.a.jaffe at jpmchase.com <leonard.a.jaffe at jpmchase.
> com> wrote:
> >
> > Fayland Lam <fayland at gmail.com> wrote:
> > >
> > > Lee Standen wrote:
> > > > It's a subroutine, right?
> > > >
> > > > Tried a return?....such as:
> > > >
> > > > $c->res->redirect('http://www.yahoo.com');
> > > > return undef;
> > >
> > > Indeed I want to run the 'while' loop in backend. 'return' would not
run
> > > the loop I think.
> >
> > Why do you want to run the loop in the background?
> > What purpose will it serve?
> >
> > If we can learn your motivation, we can try to find you
> > At Least One Way To Do It.
>
> It's not that unusual to want to send a response before doing
> expensive operations, so that the user doesn't have to wait.
>
> Does fork() play well with catalyst? (I've not yet had a need to tryit
myself)

I never have tried fork() here.   I use mod_perl and it seems silly to hold
a MP proc hostage for long running tasks,  I usually insert a command queue
into a database and have an external script (daemon) run the queue and
update the status/results.   This allows for very long running external
commands that are not imposing on your mod_perl config, and also has the
added benefit of allowing to distribute those commands across multiple
machines if need be.

>
> Carl




More information about the Catalyst mailing list