Mailing List Archive

Help on Catalyst::Plugin::RunAfterRequest
Hello,
I plan to run server code in asynchronous mode after a response back to the
client made from an action code in a Catalyst controller.

I'm using Catalyst::Plugin::RunAfterRequest plugin in a Catalyst 5.80
environment started in 'FastCGI' mode, called by Apache2 httpd server, with
FastCgiExternalServer directive of mod_fastcgi.c module (v2.4.6), in a Linux
UBUNTU box with Perl 5.12.4.

It seems, in that environment, response for client request occurs after long
time processing, differently that I run Catalyst Runtime in 'Server' mode
where response back to the client occurs immediately and long time processing
occurs delayed.

Can somebody tell me this behavior is correct or there is something wrong?
Are there better methods to call long-time-running code across
Apache/FastCGI/Catalyst ?

Thanks for feedback.
Antonio Soro.

-----------------------------------------------------------------------
Questa comunicazione e ogni eventuale file allegato sono confidenziali
e destinati all'uso esclusivo del destinatario. Se avete ricevuto
questo messaggio per errore Vi preghiamo di comunicarlo al mittente e
distruggere quanto ricevuto.


_______________________________________________
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/
Re: Help on Catalyst::Plugin::RunAfterRequest [ In reply to ]
If you run a long-running process inside of your webserver process the
process will not be available to handle new web requests anymore. you
probably want a job-queue of some sort.

http://stackoverflow.com/questions/25277158/run-asynchronous-methods-in-catalyst-perl

http://blogs.perl.org/users/davewood/2014/07/asynchronuous-task-distribution-with-anyevent-and-zeromq.html

cheers
david

On 6 October 2014 15:53, Antonio Soro <antonio.soro@koinesistemi.it> wrote:
> Hello,
> I plan to run server code in asynchronous mode after a response back to the
> client made from an action code in a Catalyst controller.
>
> I'm using Catalyst::Plugin::RunAfterRequest plugin in a Catalyst 5.80
> environment started in 'FastCGI' mode, called by Apache2 httpd server, with
> FastCgiExternalServer directive of mod_fastcgi.c module (v2.4.6), in a Linux
> UBUNTU box with Perl 5.12.4.
>
> It seems, in that environment, response for client request occurs after long
> time processing, differently that I run Catalyst Runtime in 'Server' mode
> where response back to the client occurs immediately and long time processing
> occurs delayed.
>
> Can somebody tell me this behavior is correct or there is something wrong?
> Are there better methods to call long-time-running code across
> Apache/FastCGI/Catalyst ?
>
> Thanks for feedback.
> Antonio Soro.
>
> -----------------------------------------------------------------------
> Questa comunicazione e ogni eventuale file allegato sono confidenziali
> e destinati all'uso esclusivo del destinatario. Se avete ricevuto
> questo messaggio per errore Vi preghiamo di comunicarlo al mittente e
> distruggere quanto ricevuto.
>
>
> _______________________________________________
> 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/
Re: Help on Catalyst::Plugin::RunAfterRequest [ In reply to ]
Although that plugin might have some convenience value for development, I can't see using it for real work. If you need to process long running tasks your best best is a job queue. You can setup one or use one of many available infrastructure as a service systems. (see Iron.io. etc)

jnap


On Monday, October 6, 2014 8:53 AM, Antonio Soro <antonio.soro@koinesistemi.it> wrote:



Hello,
I plan to run server code in asynchronous mode after a response back to the
client made from an action code in a Catalyst controller.

I'm using Catalyst::Plugin::RunAfterRequest plugin in a Catalyst 5.80
environment started in 'FastCGI' mode, called by Apache2 httpd server, with
FastCgiExternalServer directive of mod_fastcgi.c module (v2.4.6), in a Linux
UBUNTU box with Perl 5.12.4.

It seems, in that environment, response for client request occurs after long
time processing, differently that I run Catalyst Runtime in 'Server' mode
where response back to the client occurs immediately and long time processing
occurs delayed.

Can somebody tell me this behavior is correct or there is something wrong?
Are there better methods to call long-time-running code across
Apache/FastCGI/Catalyst ?

Thanks for feedback.
Antonio Soro.

-----------------------------------------------------------------------
Questa comunicazione e ogni eventuale file allegato sono confidenziali
e destinati all'uso esclusivo del destinatario. Se avete ricevuto
questo messaggio per errore Vi preghiamo di comunicarlo al mittente e
distruggere quanto ricevuto.


_______________________________________________
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/
Re: Help on Catalyst::Plugin::RunAfterRequest [ In reply to ]
Although that plugin might have some convenience value for development, I can't see using it for real work. If you need to process long running tasks your best best is a job queue. You can setup one or use one of many available infrastructure as a service systems. (see Iron.io. etc)

jnap


On Monday, October 6, 2014 8:53 AM, Antonio Soro <antonio.soro@koinesistemi.it> wrote:



Hello,
I plan to run server code in asynchronous mode after a response back to the
client made from an action code in a Catalyst controller.

I'm using Catalyst::Plugin::RunAfterRequest plugin in a Catalyst 5.80
environment started in 'FastCGI' mode, called by Apache2 httpd server, with
FastCgiExternalServer directive of mod_fastcgi.c module (v2.4.6), in a Linux
UBUNTU box with Perl 5.12.4.

It seems, in that environment, response for client request occurs after long
time processing, differently that I run Catalyst Runtime in 'Server' mode
where response back to the client occurs immediately and long time processing
occurs delayed.

Can somebody tell me this behavior is correct or there is something wrong?
Are there better methods to call long-time-running code across
Apache/FastCGI/Catalyst ?

Thanks for feedback.
Antonio Soro.

-----------------------------------------------------------------------
Questa comunicazione e ogni eventuale file allegato sono confidenziali
e destinati all'uso esclusivo del destinatario. Se avete ricevuto
questo messaggio per errore Vi preghiamo di comunicarlo al mittente e
distruggere quanto ricevuto.


_______________________________________________
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/