Author: stas
Date: Wed Dec 8 17:40:25 2004
New Revision: 111337
URL: http://svn.apache.org/viewcvs?view=revrev=111337
Log:
new function server_shutdown_cleanup_register
Modified:
perl/modperl/docs/trunk/src/docs/2.0/api/Apache/ServerUtil.pod
perl/modperl/docs/trunk/src/docs/2.0/user/coding/coding.pod
perl/modperl/docs/trunk/src/docs/2.0/user/porting/compat.pod
Modified: perl/modperl/docs/trunk/src/docs/2.0/api/Apache/ServerUtil.pod
Url:
http://svn.apache.org/viewcvs/perl/modperl/docs/trunk/src/docs/2.0/api/Apache/ServerUtil.pod?view=diffrev=111337p1=perl/modperl/docs/trunk/src/docs/2.0/api/Apache/ServerUtil.podr1=111336p2=perl/modperl/docs/trunk/src/docs/2.0/api/Apache/ServerUtil.podr2=111337
==
--- perl/modperl/docs/trunk/src/docs/2.0/api/Apache/ServerUtil.pod
(original)
+++ perl/modperl/docs/trunk/src/docs/2.0/api/Apache/ServerUtil.pod Wed Dec
8 17:40:25 2004
@@ -47,8 +47,7 @@
$s-method_register('NEWGET');
# register server shutdown callback
- $base_server_pool = Apache::ServerUtil::base_server_pool();
- $base_server_pool-cleanup_register(sub { Apache::OK });
+ Apache::ServerUtil::server_shutdown_register_cleanup(sub { Apache::OK });
# do something only when the server restarts
my $cnt = Apache::ServerUtil::restart_count();
@@ -188,22 +187,25 @@
-=head2 Cbase_server_pool
+=head2 Cserver_shutdown_cleanup_register
-Get the base server pool object:
+Register server shutdown cleanup callback:
- $base_server_pool = Apache::ServerUtil::base_server_pool();
+ Apache::ServerUtil::server_shutdown_cleanup_register($sub);
=over 4
-=item ret: Cbase_server_pool
-( CLAPR::Pool object|docs::2.0::api::APR::Pool )
+=item arg1: C$sub ( CODE ref or SUB name )
+
+
+
+=item ret: no return value
=item since: 1.99_18
=back
-This pool can be used to register a callback to be run once at the
+This function can be used to register a callback to be run once at the
server shutdown (compared to
CLPerlChildExitHandler|docs::2.0::user::handlers::server/C_PerlChildExitHandler_
which will execute the callback for each exiting child process).
@@ -212,13 +214,12 @@
run every time the server shuts down (or restarts), run the following
code at the server startup:
- $base_server_pool = Apache::ServerUtil::base_server_pool();
- $base_server_pool-cleanup_register(\do_my_cleanups);
+ Apache::ServerUtil::server_shutdown_cleanup_register(\do_my_cleanups);
It's necessary to run this code at the server startup (normally
-Fstartup.pl. Cleanup handlers registered after the
+Fstartup.pl. The function will croak if run after the
CLPerlPostConfigHandler|docs::2.0::user::handlers::server/C_PerlPostConfigHandler_
-phase will be silently ignored.
+phase.
Modified: perl/modperl/docs/trunk/src/docs/2.0/user/coding/coding.pod
Url:
http://svn.apache.org/viewcvs/perl/modperl/docs/trunk/src/docs/2.0/user/coding/coding.pod?view=diffrev=111337p1=perl/modperl/docs/trunk/src/docs/2.0/user/coding/coding.podr1=111336p2=perl/modperl/docs/trunk/src/docs/2.0/user/coding/coding.podr2=111337
==
--- perl/modperl/docs/trunk/src/docs/2.0/user/coding/coding.pod (original)
+++ perl/modperl/docs/trunk/src/docs/2.0/user/coding/coding.pod Wed Dec 8
17:40:25 2004
@@ -68,7 +68,7 @@
To run something at the server shutdown and restart use a cleanup
handler registered on
-CLbase_server_pool()|docs::2.0::api::Apache::ServerUtil/C_base_server_pool_
+CLserver_shutdown_cleanup_register()|docs::2.0::api::Apache::ServerUtil/C_server_shutdown_cleanup_register_
in Fstartup.pl:
#PerlRequire startup.pl
@@ -76,8 +76,7 @@
use APR::Pool ();
warn parent pid is $$\n;
- $base_server_pool = Apache::ServerUtil::base_server_pool();
- $base_server_pool-cleanup_register(\cleanup);
+ Apache::ServerUtil::server_shutdown_cleanup_register((\cleanup);
sub cleanup { warn server cleanup in $$\n }
This is usually useful when some server-wide cleanup should be
Modified: perl/modperl/docs/trunk/src/docs/2.0/user/porting/compat.pod
Url:
http://svn.apache.org/viewcvs/perl/modperl/docs/trunk/src/docs/2.0/user/porting/compat.pod?view=diffrev=111337p1=perl/modperl/docs/trunk/src/docs/2.0/user/porting/compat.podr1=111336p2=perl/modperl/docs/trunk/src/docs/2.0/user/porting/compat.podr2=111337
==
--- perl/modperl/docs/trunk/src/docs/2.0/user/porting/compat.pod
(original)
+++ perl/modperl/docs/trunk/src/docs/2.0/user/porting/compat.podWed Dec
8 17:40:25 2004
@@ -822,9 +822,9 @@
CLPerlChildExitHandler|docs::2.0::user::handlers::server/C_PerlChildExitHandler_.
In order to register a cleanup handler to be run only once when the
-main server (not each child process) shutsdown, you can register a
-cleanup handler on the