Hi, I tried Catalyst::Plugin::RunAfterRequest, when I send request to the app, it returns fine but it does not accept any other request after that until that sub routine finishes.
I created 2 methods, 1 for running other methods using run_after_request and second method to check status. Now, when I call first method it returns the result quickly but when I method to check status it keeps waiting until first method finishes, I tried to call other methods not related to run_after_request but all the requests go into wait. Any idea what is wrong? On Sun, Feb 24, 2013 at 9:46 PM, James R. Leu <j...@mindspring.com> wrote: > I do not have any suggestions about the App1 to App2 hand off > but perhaps my technique for handling async/long running requests > will help. > > I solved my async requirements by using Catalyst::Plugin::Cache > and Catalyst::Plugin::RunAfterRequest. > > First off, I have my catalyst apps setup to run as FCGI with many > children (50-100) depending on the app. All the clients are implemented > in javascript and make periodic ajax requests. > > In my catalyst actions that need to be async: > - check if the request contains a job id > - if so check the cache for the status of the job id > - if the job is done, then return the results, and clear the cache > - else return a response telling the client to come back later > - otherwise create a new cache entry and immediately return a job id > to the client, and tell it to come back later > - after the response is sent, using RunAfterRequest I start the > long running action (in essence consuming this FCGI child > for the duration of the long running action) > - at the end of the RunAfterRequest action I update the cache > with the results > > You will need to choose a Catalyst::Plugin::Cache backend that > meets your need. > > On Sun, Feb 24, 2013 at 10:41:16AM +0530, linuxsupport wrote: > > any other idea on this? > > > > On Sat, Feb 23, 2013 at 12:31 PM, Francisco Obispo <fobi...@isc.org> > wrote: > > > > > I would probably use a message queue. > > > > > > Have you looked into RabbitMQ ? > > > > > > App 1 would be the producer, and you would have a consumer, responsible > > > for performing the operation on App 2. > > > > > > > > > > > > > > > > > > On Feb 22, 2013, at 10:40 PM, linuxsupport <lin.supp...@gmail.com> > wrote: > > > > > > > Hi All, > > > > > > > > I need your help on the following scenario. > > > > > > > > I have 2 Catalyst apps, say App 1 and App 2 > > > > > > > > Now, User access the App 1 and request something, App 1 then connect > to > > > App 2 for the information but getting that information takes sometime > lets > > > say 15 minutes. > > > > > > > > What I want to implement is that, App 1 checks the status of request > > > which was sent to App 2 every 2 minutes and once completed it gets the > > > response. > > > > > > > > Checking the status every 2 minutes can be controlled from the > browser > > > using Ajax, client side code can send status request to App 1, App 1 > can > > > forward this request to App 2, but how App2 will maintain the state and > > > keep the job running even if App 1 gets disconnect from App 2. > > > > > > > > Is there something similar to Ajax for Catalyst to Catalyst > > > communication? > > > > > > > > I can create a table on App 2 and store the request, and run a cron > > > script to process the request and update table with result, App 1 can > then > > > pull the information from that table but looking for more elegant way > to do > > > it. > > > > > > > > Thanks > > > > > > > > _______________________________________________ > > > > List: Catalyst@lists.scsys.co.uk > > > > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > > > > Searchable archive: > > > http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ > > > > Dev site: http://dev.catalyst.perl.org/ > > > > > > Francisco Obispo > > > Director of Applications and Services - ISC > > > email: fobi...@isc.org > > > Phone: +1 650 423 1374 || INOC-DBA *3557* NOC > > > PGP KeyID = B38DB1BE > > > > > > > > > _______________________________________________ > > > List: Catalyst@lists.scsys.co.uk > > > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > > > Searchable archive: > > > http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ > > > Dev site: http://dev.catalyst.perl.org/ > > > > > > -- > James R. Leu > j...@mindspring.com > > _______________________________________________ > List: Catalyst@lists.scsys.co.uk > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: > http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ > Dev site: http://dev.catalyst.perl.org/ > >
_______________________________________________ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/