Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 12aef6395c3678c929b08cd723fc1673 > files > 82

mod_python-2.7.6-1mdk.i586.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>4.3.6 Internal Callback Object&nbsp;</title>
<META NAME="description" CONTENT="4.3.6 Internal Callback Object&nbsp;">
<META NAME="keywords" CONTENT="modpython">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="STYLESHEET" href="modpython.css">
<LINK REL="previous" href="pyapi-debug.html">
<LINK REL="up" href="module-apache.html">
<LINK REL="next" href="pyapi-util.html">
</head>
<body>
<DIV CLASS="navigation">
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td><A href="pyapi-debug.html"><img src="icons/previous.gif"
  border="0" height="32"
  alt="Previous Page" width="32"></A></td>
<td><A href="module-apache.html"><img src="icons/up.gif"
  border="0" height="32"
  alt="Up One Level" width="32"></A></td>
<td><A href="pyapi-util.html"><img src="icons/next.gif"
  border="0" height="32"
  alt="Next Page" width="32"></A></td>
<td align="center" width="100%">Mod_python Manual</td>
<td><A href="contents.html"><img src="icons/contents.gif"
  border="0" height="32"
  alt="Contents" width="32"></A></td>
<td><img src="icons/blank.gif"
  border="0" height="32"
  alt="" width="32"></td>
<td><A href="genindex.html"><img src="icons/index.gif"
  border="0" height="32"
  alt="Index" width="32"></A></td>
</tr></table>
<b class="navlabel">Previous:</b> <a class="sectref" href="pyapi-debug.html">4.3.5 Debugging</A>
<b class="navlabel">Up:</b> <a class="sectref" href="module-apache.html">4.3 apache - Access</A>
<b class="navlabel">Next:</b> <a class="sectref" href="pyapi-util.html">4.4 util - Miscellaneous</A>
<br><hr>
</DIV>
<!--End of Navigation Panel-->

<H2><A NAME="SECTION006360000000000000000">&nbsp;</A>
<BR>
4.3.6 Internal Callback Object<a name='l2h-119'>&nbsp;</a>
</H2>

<P>
The Apache server interfaces with the Python interpreter via a
callback object obCallBack. When a subinterpreter is created, an
instance of obCallBack is created in this
subinterpreter. Interestingly, obCallBack is not written in C, it is
written in Python and the code for it is in the apache module.
Mod_python only uses the C API to import apache and then instantiate
obCallBack, storing a reference to the instance in the interpreter
dictionary described above. Thus, the values in the interpreter
dictionary are callback object instances.

<P>
When a request handler is invoked by Apache, mod_python uses the
obCallBack reference to call its method Dispatch, passing it the name
of the handler being invoked as a string.

<P>
The Dispatch method then does the rest of the work of importing the
user module, resolving the callable object in it and calling it
passing it a request object.

<P>

<DIV CLASS="navigation">
<p><hr>
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td><A href="pyapi-debug.html"><img src="icons/previous.gif"
  border="0" height="32"
  alt="Previous Page" width="32"></A></td>
<td><A href="module-apache.html"><img src="icons/up.gif"
  border="0" height="32"
  alt="Up One Level" width="32"></A></td>
<td><A href="pyapi-util.html"><img src="icons/next.gif"
  border="0" height="32"
  alt="Next Page" width="32"></A></td>
<td align="center" width="100%">Mod_python Manual</td>
<td><A href="contents.html"><img src="icons/contents.gif"
  border="0" height="32"
  alt="Contents" width="32"></A></td>
<td><img src="icons/blank.gif"
  border="0" height="32"
  alt="" width="32"></td>
<td><A href="genindex.html"><img src="icons/index.gif"
  border="0" height="32"
  alt="Index" width="32"></A></td>
</tr></table>
<b class="navlabel">Previous:</b> <a class="sectref" href="pyapi-debug.html">4.3.5 Debugging</A>
<b class="navlabel">Up:</b> <a class="sectref" href="module-apache.html">4.3 apache - Access</A>
<b class="navlabel">Next:</b> <a class="sectref" href="pyapi-util.html">4.4 util - Miscellaneous</A>
<hr>
<span class="release-info">Release 2.7.6, documentation updated on August 04, 2001.</span>
</DIV>
<!--End of Navigation Panel-->

</BODY>
</HTML>