mod_perl logo perl icon
previous page: Apache2::Log - Perl API for Apache Logging Methodspage up: mod_perl 2.0 APInext page: Apache2::Module - Perl API for creating and working with Apache modules

Apache2::MPM - Perl API for accessing Apache MPM information






Embedding Perl in HTML with Mason

Embedding Perl in HTML with Mason

By Dave Rolsky, Ken Williams
mod_perl2 User's Guide

mod_perl2 User's Guide

By Stas Bekman, Jim Brandt
Practical mod_perl

Practical mod_perl

By Stas Bekman, Eric Cholet
The mod_perl Developer's Cookbook

The mod_perl Developer's Cookbook

By Geoffrey Young, Paul Lindner, Randy Kobes
mod_perl Pocket Reference

mod_perl Pocket Reference

By Andrew Ford
Writing Apache Modules with Perl and C

Writing Apache Modules with Perl and C

By Lincoln Stein, Doug MacEachern


Table of Contents

Synopsis

  use Apache2::MPM ();
  
  # check whether Apache MPM is threaded
  if (Apache2::MPM->is_threaded) { do_something() }
  
  # which mpm is used
  my $mpm = lc Apache2::MPM->show;
  
  # query mpm properties
  use Apache2::Const -compile => qw(:mpmq);
  if (Apache2::MPM->query(Apache2::Const::MPMQ_STATIC)) { ... }


TOP

Description

Apache2::MPM provides the Perl API for accessing Apache MPM information.



TOP

API

Apache2::MPM provides the following functions and/or methods:



TOP

query

Query various attributes of the MPM

  my $query = Apache2::MPM->query($const);

For example to test whether the mpm is static:

  use Apache2::Const -compile => qw(MPMQ_STATIC);
  if (Apache2::MPM->query(Apache2::Const::MPMQ_STATIC)) { ... }


TOP

is_threaded

Check whether the running Apache MPM is threaded.

  my $is_threaded = Apache2::MPM->is_threaded;

Note that this functionality is just a shortcut for:

  use Apache2::Const -compile => qw(MPMQ_IS_THREADED);
  my $is_threaded = Apache2::MPM->query(Apache2::Const::MPMQ_IS_THREADED);


TOP

show

What mpm is used

  my $mpm = Apache2::MPM->show();


TOP

See Also

mod_perl 2.0 documentation.



TOP

Copyright

mod_perl 2.0 and its core modules are copyrighted under The Apache Software License, Version 2.0.



TOP

Authors

The mod_perl development team and numerous contributors.






TOP
previous page: Apache2::Log - Perl API for Apache Logging Methodspage up: mod_perl 2.0 APInext page: Apache2::Module - Perl API for creating and working with Apache modules