Apache-Backhand

 view release on metacpan or  search on metacpan

Backhand.pm  view on Meta::CPAN

 }

 (the following constants are also provided...)
 Apache::Backhand::MAXSERVERS;
 Apache::Backhand::MAXSESSIONSPERSERVER;
 Apache::Backhand::SERVER_TIMEOUT;

=head1 DESCRIPTION

Apache::Backhand ties mod_perl together with mod_backhand, in two major ways.
First, the Apache::Backhand module itself provides access to the global and
shared state information provided by mod_backhand (most notably serverstats).
Second, the byPerl C function (which is not part of the Apache::Backhand
module, but is distributed together with it) allows you to write candidacy
functions in Perl.

Apache::Backhand will crash your perl interpreter if you attempt to load it
into a perl binary which isn't also part of apache, with both mod_perl and
mod_backhand loaded.  You'll get 'unresolved symbol' errors, or whatever their
equivalent is on your system.  This may seem obvious, but it has a less obvious
side effect, which is that you cannot load Apache::Backhand until *after*

Backhand.pm  view on Meta::CPAN

      $server->{'load'} += 1;
  }

Note that each of the elements of the hashes is magically tied directly (for
both reads and writes) into the shared memory segment where serverstats
resides.  You can call load_serverstats() once, and use the returned structure
as much as you want - it will always reflect the contents of the underlying
shared structure.  This has one drawback, however, which is that you cannot
call load_serverstats() until after the shared memory segment has been created
and attached.  I recommend a PerlChildInit handler to do load_serverstats()
into a global variable.

=item B<load_personal_arriba>

This function returns a reference to a scalar variable which is magically
tied to the global mod_backhand_personal_arriba integer.  This contains the
arriba speed of the local machine.

=back

=head1 CAVEATS

As explained above, you cannot PerlModule or use() or require()
Apache::Backhand until *after* mod_backhand (and mod_perl, of course) are
linked into the server.

README  view on Meta::CPAN


Copyright (c) 2000 David Lowe.  All rights reserved.  This program is free
software; you can redistribute it and/or modify it under the same terms as
Perl itself. 


Description
===========

Apache::Backhand ties mod_perl together with mod_backhand, in two major ways.
First, the Apache::Backhand module itself provides access to the global and
shared state information provided by mod_backhand (most notably serverstats).
Second, the byPerl C function (which is not part of the Apache::Backhand
module, but is distributed together with it) allows you to write candidacy
functions in Perl.

In case this is all new to you, here are three links for background
information:

The Backhand Project                - http://www.backhand.org/
The Apache/Perl Integration Project - http://perl.apache.org/

ppport.h  view on Meta::CPAN

   with the Perl maintainers. */
   
/* If you needed to customize this file for your project, please mention
   your changes, and visible alter the version number. */


/*
   In order for a Perl extension module to be as portable as possible
   across differing versions of Perl itself, certain steps need to be taken.
   Including this header is the first major one, then using dTHR is all the
   appropriate places and using a PL_ prefix to refer to global Perl
   variables is the second.
*/


/* If you use one of a few functions that were not present in earlier
   versions of Perl, please add a define before the inclusion of ppport.h
   for a static include, or use the GLOBAL request in a single module to
   produce a global definition that can be referenced from the other
   modules.
   
   Function:            Static define:           Extern define:
   newCONSTSUB()        NEED_newCONSTSUB         NEED_newCONSTSUB_GLOBAL

*/
 

/* To verify whether ppport.h is needed for your module, and whether any
   special defines should be used, ppport.h can be run through Perl to check
   your source code. Simply say:
   
   	perl -x ppport.h *.c *.h *.xs foo/*.c [etc]
   
   The result will be a list of patches suggesting changes that should at
   least be acceptable, if not necessarily the most efficient solution, or a
   fix for all possible problems. It won't catch where dTHR is needed, and
   doesn't attempt to account for global macro or function definitions,
   nested includes, typemaps, etc.
   
   In order to test for the need of dTHR, please try your module under a
   recent version of Perl that has threading compiled-in.
 
*/ 


/*
#!/usr/bin/perl
@ARGV = ("*.xs") if !@ARGV;
%badmacros = %funcs = %macros = (); $replace = 0;
foreach (<DATA>) {
	$funcs{$1} = 1 if /Provide:\s+(\S+)/;
	$macros{$1} = 1 if /^#\s*define\s+([a-zA-Z0-9_]+)/;
	$replace = $1 if /Replace:\s+(\d+)/;
	$badmacros{$2}=$1 if $replace and /^#\s*define\s+([a-zA-Z0-9_]+).*?\s+([a-zA-Z0-9_]+)/;
	$badmacros{$1}=$2 if /Replace (\S+) with (\S+)/;
}
foreach $filename (map(glob($_),@ARGV)) {
	unless (open(IN, "<$filename")) {
		warn "Unable to read from $file: $!\n";
		next;
	}
	print "Scanning $filename...\n";
	$c = ""; while (<IN>) { $c .= $_; } close(IN);
	$need_include = 0; %add_func = (); $changes = 0;
	$has_include = ($c =~ /#.*include.*ppport/m);

	foreach $func (keys %funcs) {



( run in 1.994 second using v1.01-cache-2.11-cpan-1d5ca39e368 )