Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
PerlCleanupHandler substitute
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
dstroma  
View profile  
 More options Jul 3 2012, 4:09 pm
From: dstroma <dstr...@gmail.com>
Date: Tue, 3 Jul 2012 13:09:59 -0700 (PDT)
Local: Tues, Jul 3 2012 4:09 pm
Subject: PerlCleanupHandler substitute

Hi,

I am converting some apps over from mod_perl and I'm trying to figure out
how to replace functionality previously performed in a PerlCleanupHandler.
It was useful for doing some work at the end of the request without
blocking the client.

PerlCleanupHandler<http://perl.apache.org/docs/2.0/user/handlers/http.html#toc_PerlClean...>

> There is no *cleanup* Apache phase, it exists only inside mod_perl. It is
> used to execute some code immediately after the request has been served
> (the client went away) and before the request object is destroyed.

> There are several usages for this use phase. The obvious one is to run a
> cleanup code, for example removing temporarily created files. The less
> obvious is to use this phase instead of PerlLogHandler<http://perl.apache.org/docs/2.0/user/handlers/http.html#PerlLogHandler>if the logging operation is time consuming. This approach allows to free
> the client as soon as the response is sent.

I tried using the "streaming body" feature of the PSGI spec, by calling
$writer->close and then doing the cleanup work, but that seems to be
blocking also; plus, is a bit of a complicated way of doing it when the
rest of the app doesn't really need streaming.

Any other solutions?

Thanks


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tatsuhiko Miyagawa  
View profile  
 More options Jul 4 2012, 2:21 am
From: Tatsuhiko Miyagawa <miyag...@gmail.com>
Date: Tue, 3 Jul 2012 23:21:13 -0700
Local: Wed, Jul 4 2012 2:21 am
Subject: Re: PerlCleanupHandler substitute

There was a discussion and proposal about adding the equivalent of this
with psgix.cleanup callbacks a while ago (check github wiki of psgi-specs
repo) but so far as I know none of the servers has implemented it.

The easiest workaround would be to make a simple job queue (probably one of
the existing one off of CPAN) to launch them in the background.

Sent from my iPad

On Jul 3, 2012, at 2:09 PM, dstroma <dstr...@gmail.com> wrote:

Hi,

I am converting some apps over from mod_perl and I'm trying to figure out
how to replace functionality previously performed in a PerlCleanupHandler.
It was useful for doing some work at the end of the request without
blocking the client.

PerlCleanupHandler<http://perl.apache.org/docs/2.0/user/handlers/http.html#toc_PerlClean...>

> There is no *cleanup* Apache phase, it exists only inside mod_perl. It is
> used to execute some code immediately after the request has been served
> (the client went away) and before the request object is destroyed.

> There are several usages for this use phase. The obvious one is to run a
> cleanup code, for example removing temporarily created files. The less
> obvious is to use this phase instead of PerlLogHandler<http://perl.apache.org/docs/2.0/user/handlers/http.html#PerlLogHandler>if the logging operation is time consuming. This approach allows to free
> the client as soon as the response is sent.

I tried using the "streaming body" feature of the PSGI spec, by calling
$writer->close and then doing the cleanup work, but that seems to be
blocking also; plus, is a bit of a complicated way of doing it when the
rest of the app doesn't really need streaming.

Any other solutions?

Thanks


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »