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

Rhesa Rozendaal perl at rhesa.com
Mon Aug 10 12:17:38 EDT 2009


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 flexibility and store the jobs in the 
> database (as serialized data structures). Then my web processes can query the DB 
> to see if the job in question has finished and thus give a progress report to 
> the user.
> 
>> Second, I must be
>> able to schedule it at a future time. I am currently using Schedule::At
>> to do this. Again both are fragile and as you correctly pointed out,
>> will suffer when scaled.
> 
> My queue also allows this, but I'm not sure how TheSchwartz or Gearman handle that.
> 


I'm happily using beanstalk for this (http://xph.us/software/beanstalkd/), 
through Beanstalk::Client. Very light-weight, and very easy to work with. 
Delaying jobs into the future is also possible (and I use that extensively).

When I need to keep the user informed of the current status, I tend to track 
that in a database, or even in memcached if it isn't vitally important.

Rhesa


More information about the cgiapp mailing list