On 11/10/2010 20:48, Nick Kew wrote:
On Mon, 11 Oct 2010 15:14:02 +0100
Martin Townsendmartin.towns...@power-oasis.com wrote:
Hi,
I have created a pool from the child pool for storing warning messages
that can live across requests, the final request will insert the
warnings into the response. How do I ensure that this pool is cleared
at the end of the final request?
That doesn't really make sense. What is the final request?
If it's requests in a connection, use the connection pool.
Otherwise, you're looking at a time-based solution such
as garbage collection.
Thanks for the reply and Apologies, I should have put a bit more detail
in. I'm working on a module for an embedded platform where we can use
the web server to configure the firmware. The interface between the
module and firmware allows the firmware to send back warning messages
for side effects of configuration changes. The time taken for the
configuration change will likely outlive the connection timeout. I
could increase this timeout but I would like to keep it short as you can
only connect to the web server from a local network and then I can keep
the number of child processes low.
These warnings are inserted into a response as a table within a DIV HTML
element by my output filter. So what usually happens is that the first
request is a POST with the configure command, an input filter parses
this and sends the configure to the firmware, the firmware then may send
back warning messages. Theses are collected and stored in a list. The
next request (which I wrongly referred to as the final request) will
then have the warning table inserted into the response to which the
client can then use javascript to display as an overlay.
I've implemented a solution where I use a sub pool from the child pool
which is now cleared using a flag which I set when the warnings are
processed by the output filter. The next (initial) request will then
pick up the flag and clear the pool. What I was hoping for, is a hook
at a point after the data had been sent but the flag works well.
--
Martin Townsend
Power*Oasis*
Suite 1, Unit 41
Shrivenham Hundred Business Park
Majors Road
Watchfield
Swindon
Wilts SN6 8TZ
Mobile: 07884 444658
Skype: mtownsend1973