RE: How to close connect and continue processing?

2000-09-14 Thread Vladislav Safronov

> On Thu, 14 Sep 2000, Vladislav Safronov wrote:
> 
> > I read the guide and I think the best is just add "&" :)
> > (how could I forget it!)
> > ..
> > system("myprog la la &");
> > print "";
> > # end
> 
> True, but what happens if your program tries to print 
> something. You've
> all in/out/err streams inherited, where in/out are tied to a 
> socket. You
> must close them at the beginning of the external script.

hm.. it's true. I should back to the guide ... 
Thanx for the help!

Vlad.

> 
> Anyway, it might be neater to use &, but performance wise is 
> not, since
> you spawn a shell. Of course for the heavily loaded systems. Fork is
> faster.
> 
> > 
> > 
> > > On Thu, 14 Sep 2000, Matt Sergeant wrote:
> > > 
> > > > On Thu, 14 Sep 2000, Matt Sergeant wrote:
> > > > 
> > > > > On Thu, 14 Sep 2000, Vladislav Safronov wrote:
> > > > > 
> > > > > > Hi,
> > > > > > 
> > > > > > After user request my script should say that the 
> > > request is accepted and
> > > > > > continue processing user data (it takes a time) so I 
> > > want to tell the
> > > > > > browser
> > > > > > that all data is sent. I searched mod_perl guide but I 
> > > didn't find such code
> > > > > > snippet.
> > > > > > Could you send me such example?
> > > > > 
> > > > > $r->register_cleanup(\&do_big_work);
> > > > 
> > > > I should have mentioned that this is far from a perfect 
> > > solution (cue
> > > > Stas) as it ties up a mod_perl process. See the guide 
> for alternate
> > > > solutions.
> > > 
> > > Like Matt has said, this used mostly for light things 
> like logging or
> > > process killing (Apache::{SizeLimit|GTopLimit}). See the 
> performance
> > > chapter for forking techniques for heavy jobs:
> > > http://perl.apache.org/guide/performance.html#Forking_and_Exec
> > > uting_Subprocess
> > > 
> > > 
> > > > 
> > > > -- 
> > > > 
> > > > 
> > > > Fastnet Software Ltd. High Performance Web Specialists
> > > > Providing mod_perl, XML, Sybase and Oracle solutions
> > > > Email for training and consultancy availability.
> > > > http://sergeant.org | AxKit: http://axkit.org
> > > > 
> > > > 
> > > 
> > > 
> > > 
> > > 
> _
> > > Stas Bekman  JAm_pH --   Just Another 
> mod_perl Hacker
> > > http://stason.org/   mod_perl Guide  
http://perl.apache.org/guide 
> > mailto:[EMAIL PROTECTED]   http://apachetoday.com http://jazzvalley.com
> > http://singlesheaven.com http://perlmonth.com   perl.org   apache.org
> > 
> > 
> 



_
Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
http://stason.org/   mod_perl Guide  http://perl.apache.org/guide 
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://jazzvalley.com
http://singlesheaven.com http://perlmonth.com   perl.org   apache.org





RE: How to close connect and continue processing?

2000-09-14 Thread Stas Bekman

On Thu, 14 Sep 2000, Vladislav Safronov wrote:

> I read the guide and I think the best is just add "&" :)
> (how could I forget it!)
>   ..
>   system("myprog la la &");
>   print "";
>   # end

True, but what happens if your program tries to print something. You've
all in/out/err streams inherited, where in/out are tied to a socket. You
must close them at the beginning of the external script.

Anyway, it might be neater to use &, but performance wise is not, since
you spawn a shell. Of course for the heavily loaded systems. Fork is
faster.

> 
> 
> > On Thu, 14 Sep 2000, Matt Sergeant wrote:
> > 
> > > On Thu, 14 Sep 2000, Matt Sergeant wrote:
> > > 
> > > > On Thu, 14 Sep 2000, Vladislav Safronov wrote:
> > > > 
> > > > > Hi,
> > > > > 
> > > > > After user request my script should say that the 
> > request is accepted and
> > > > > continue processing user data (it takes a time) so I 
> > want to tell the
> > > > > browser
> > > > > that all data is sent. I searched mod_perl guide but I 
> > didn't find such code
> > > > > snippet.
> > > > > Could you send me such example?
> > > > 
> > > > $r->register_cleanup(\&do_big_work);
> > > 
> > > I should have mentioned that this is far from a perfect 
> > solution (cue
> > > Stas) as it ties up a mod_perl process. See the guide for alternate
> > > solutions.
> > 
> > Like Matt has said, this used mostly for light things like logging or
> > process killing (Apache::{SizeLimit|GTopLimit}). See the performance
> > chapter for forking techniques for heavy jobs:
> > http://perl.apache.org/guide/performance.html#Forking_and_Exec
> > uting_Subprocess
> > 
> > 
> > > 
> > > -- 
> > > 
> > > 
> > > Fastnet Software Ltd. High Performance Web Specialists
> > > Providing mod_perl, XML, Sybase and Oracle solutions
> > > Email for training and consultancy availability.
> > > http://sergeant.org | AxKit: http://axkit.org
> > > 
> > > 
> > 
> > 
> > 
> > _
> > Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
> > http://stason.org/   mod_perl Guide  http://perl.apache.org/guide 
> > mailto:[EMAIL PROTECTED]   http://apachetoday.com http://jazzvalley.com
> > http://singlesheaven.com http://perlmonth.com   perl.org   apache.org
> > 
> > 
> 



_
Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
http://stason.org/   mod_perl Guide  http://perl.apache.org/guide 
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://jazzvalley.com
http://singlesheaven.com http://perlmonth.com   perl.org   apache.org





RE: How to close connect and continue processing?

2000-09-14 Thread Vladislav Safronov

I read the guide and I think the best is just add "&" :)
(how could I forget it!)
..
system("myprog la la &");
print "";
# end


> On Thu, 14 Sep 2000, Matt Sergeant wrote:
> 
> > On Thu, 14 Sep 2000, Matt Sergeant wrote:
> > 
> > > On Thu, 14 Sep 2000, Vladislav Safronov wrote:
> > > 
> > > > Hi,
> > > > 
> > > > After user request my script should say that the 
> request is accepted and
> > > > continue processing user data (it takes a time) so I 
> want to tell the
> > > > browser
> > > > that all data is sent. I searched mod_perl guide but I 
> didn't find such code
> > > > snippet.
> > > > Could you send me such example?
> > > 
> > > $r->register_cleanup(\&do_big_work);
> > 
> > I should have mentioned that this is far from a perfect 
> solution (cue
> > Stas) as it ties up a mod_perl process. See the guide for alternate
> > solutions.
> 
> Like Matt has said, this used mostly for light things like logging or
> process killing (Apache::{SizeLimit|GTopLimit}). See the performance
> chapter for forking techniques for heavy jobs:
> http://perl.apache.org/guide/performance.html#Forking_and_Exec
> uting_Subprocess
> 
> 
> > 
> > -- 
> > 
> > 
> > Fastnet Software Ltd. High Performance Web Specialists
> > Providing mod_perl, XML, Sybase and Oracle solutions
> > Email for training and consultancy availability.
> > http://sergeant.org | AxKit: http://axkit.org
> > 
> > 
> 
> 
> 
> _
> Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
> http://stason.org/   mod_perl Guide  http://perl.apache.org/guide 
> mailto:[EMAIL PROTECTED]   http://apachetoday.com http://jazzvalley.com
> http://singlesheaven.com http://perlmonth.com   perl.org   apache.org
> 
> 



Re: How to close connect and continue processing?

2000-09-14 Thread Stas Bekman

On Thu, 14 Sep 2000, Matt Sergeant wrote:

> On Thu, 14 Sep 2000, Matt Sergeant wrote:
> 
> > On Thu, 14 Sep 2000, Vladislav Safronov wrote:
> > 
> > > Hi,
> > > 
> > > After user request my script should say that the request is accepted and
> > > continue processing user data (it takes a time) so I want to tell the
> > > browser
> > > that all data is sent. I searched mod_perl guide but I didn't find such code
> > > snippet.
> > > Could you send me such example?
> > 
> > $r->register_cleanup(\&do_big_work);
> 
> I should have mentioned that this is far from a perfect solution (cue
> Stas) as it ties up a mod_perl process. See the guide for alternate
> solutions.

Like Matt has said, this used mostly for light things like logging or
process killing (Apache::{SizeLimit|GTopLimit}). See the performance
chapter for forking techniques for heavy jobs:
http://perl.apache.org/guide/performance.html#Forking_and_Executing_Subprocess


> 
> -- 
> 
> 
> Fastnet Software Ltd. High Performance Web Specialists
> Providing mod_perl, XML, Sybase and Oracle solutions
> Email for training and consultancy availability.
> http://sergeant.org | AxKit: http://axkit.org
> 
> 



_
Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
http://stason.org/   mod_perl Guide  http://perl.apache.org/guide 
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://jazzvalley.com
http://singlesheaven.com http://perlmonth.com   perl.org   apache.org





Re: How to close connect and continue processing?

2000-09-14 Thread Matt Sergeant

On Thu, 14 Sep 2000, Matt Sergeant wrote:

> On Thu, 14 Sep 2000, Vladislav Safronov wrote:
> 
> > Hi,
> > 
> > After user request my script should say that the request is accepted and
> > continue processing user data (it takes a time) so I want to tell the
> > browser
> > that all data is sent. I searched mod_perl guide but I didn't find such code
> > snippet.
> > Could you send me such example?
> 
> $r->register_cleanup(\&do_big_work);

I should have mentioned that this is far from a perfect solution (cue
Stas) as it ties up a mod_perl process. See the guide for alternate
solutions.

-- 


Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org | AxKit: http://axkit.org




Re: How to close connect and continue processing?

2000-09-14 Thread Matt Sergeant

On Thu, 14 Sep 2000, Vladislav Safronov wrote:

> Hi,
> 
> After user request my script should say that the request is accepted and
> continue processing user data (it takes a time) so I want to tell the
> browser
> that all data is sent. I searched mod_perl guide but I didn't find such code
> snippet.
> Could you send me such example?

$r->register_cleanup(\&do_big_work);

-- 


Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org | AxKit: http://axkit.org




How to close connect and continue processing?

2000-09-14 Thread Vladislav Safronov

Hi,

After user request my script should say that the request is accepted and
continue processing user data (it takes a time) so I want to tell the
browser
that all data is sent. I searched mod_perl guide but I didn't find such code
snippet.
Could you send me such example?

==

Vlad.