[cgiapp] Tasks after fork()'ing a CGI::Application

2009-08-10 Thread Gurunandan R. Bhat
Hi, I am forking a CGI::Application to perform a long-running task. The implementation is copied from this ingenious method: http://www.stonehenge.com/merlyn/LinuxMag/col39.html To summarize that article: The child process and begins the long task, logging its progress to a Cache::FileCache

Re: [cgiapp] Tasks after fork()'ing a CGI::Application

2009-08-10 Thread Michael Peters
Gurunandan R. Bhat wrote: I would like this to be as robust as possible. Currently, all I do in the child before launching the long-running process is close STDOUT. Is there any other tasks I must perform? Make sure you don't have have any other file handles in use. This includes sockets

Re: [cgiapp] Tasks after fork()'ing a CGI::Application

2009-08-10 Thread Daniel Sterling
On Mon, Aug 10, 2009 at 11:18 AM, Michael Petersmpet...@plusthree.com wrote: I would actually suggest that you don't fork your web process to do background tasks. The problem is that your web processes are generally much heavier than you need which means wasted resources. I would definitely

Re: [cgiapp] Tasks after fork()'ing a CGI::Application

2009-08-10 Thread Gurunandan R. Bhat
On Mon, 2009-08-10 at 11:18 -0400, Michael Peters wrote: I would actually suggest that you don't fork your web process to do background tasks. The problem is that your web processes are generally much heavier than you need which means wasted resources. It also can cause scalability

Re: [cgiapp] Tasks after fork()'ing a CGI::Application

2009-08-10 Thread Michael Peters
Gurunandan R. Bhat wrote: Thanks. I did seriously consider TheSchwartz and gearman. I have two features that I want to implement: First, I want to pass some feedback to the user who queued the task indicating progress. I normally use a custom job queue for more flexibility and store the jobs

Re: [cgiapp] Tasks after fork()'ing a CGI::Application

2009-08-10 Thread Rhesa Rozendaal
Michael Peters wrote: Gurunandan R. Bhat wrote: Thanks. I did seriously consider TheSchwartz and gearman. I have two features that I want to implement: First, I want to pass some feedback to the user who queued the task indicating progress. I normally use a custom job queue for more

Re: [cgiapp] Tasks after fork()'ing a CGI::Application

2009-08-10 Thread Gurunandan R. Bhat
On Mon, 2009-08-10 at 18:17 +0200, Rhesa Rozendaal wrote: Michael Peters wrote: Gurunandan R. Bhat wrote: Thanks. I did seriously consider TheSchwartz and gearman. I have two features that I want to implement: First, I want to pass some feedback to the user who queued the task

[cgiapp] Routes and get_current_runmode()

2009-08-10 Thread P Kishor
I am experiencing a problem with C::A::P::Routes, and I think I know what is going wrong, but I don’t know why or how to fix it. Background: I have implemented my application with C::A::Dispatch and C::A::P::Authentication, and it works well. For various reasons I like C::A::P::Routes, and would

[cgiapp] Re: Custom Error Messages - CGI::Applicaiton::Plugin::ValidateRM

2009-08-10 Thread Mark Stosberg
On Mon, 03 Aug 2009 14:54:10 -0700 a...@spatialsystems.org wrote: I have a textarea field to evaluate and peg errors line by line. So if line 2 and line 5 are invalid, I want to note that as two different errors. It is normal for fields to have more than one constraint, with the possiblity

[cgiapp] Re: Routes and get_current_runmode()

2009-08-10 Thread Mark Stosberg
See what is going on -- C::A::P::Routes correctly thinks the runmode is ‘mainpage’ as per the URL. However, $self-get_current_runmode() returns ‘welcome’ in cgiapp_prerun(), and as a result, the mainpage is not protected. Now, it could be that C::A::P::Routes is firing *after* my

Re: [cgiapp] Re: Routes and get_current_runmode()

2009-08-10 Thread P Kishor
On Mon, Aug 10, 2009 at 7:46 PM, Mark Stosbergm...@summersault.com wrote: See what is going on -- C::A::P::Routes correctly thinks the runmode is ‘mainpage’ as per the URL. However, $self-get_current_runmode() returns ‘welcome’ in cgiapp_prerun(), and as a result, the mainpage is not

[cgiapp] Re: Routes and get_current_runmode()

2009-08-10 Thread P Kishor
Replying to my own email to document what I have done, and seek further advice. Please see below -- On Mon, Aug 10, 2009 at 3:35 PM, P Kishorpunk.k...@gmail.com wrote: I am experiencing a problem with C::A::P::Routes, and I think I know what is going wrong, but I don’t know why or how to fix