<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Class: Engine</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="classHeader">
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Class</strong></td>
<td class="class-name-in-header">Engine</td>
</tr>
<tr class="top-aligned-row">
<td><strong>In:</strong></td>
<td>
<a href="../files/lib/engine/engine_rb.html">
lib/engine/engine.rb
</a>
<br />
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Parent:</strong></td>
<td>
Object
</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
<div id="diagram">
<map id="map" name="map">
<area shape="RECT" coords="27,113,99,161" href="Engine.html" alt="Engine
">
<area shape="RECT" coords="27,17,99,65" href="Singleton.html" alt="Singleton
">
</map>
<img src="../dot/f_17.png" usemap="#map" border=0 alt="TopLevel">
</div>
<div id="description">
<p>
The <a href="Engine.html">Engine</a> class sets up the server, polls it
regularly and observes acceptor for incoming connections.
</p>
</div>
</div>
<div id="method-list">
<h3 class="section-bar">Methods</h3>
<div class="name-list">
<a href="#M000049">graceful_shutdown</a>
<a href="#M000048">handle_signal</a>
<a href="#M000045">new</a>
<a href="#M000046">run</a>
<a href="#M000047">update</a>
</div>
</div>
</div>
<!-- if includes -->
<div id="includes">
<h3 class="section-bar">Included Modules</h3>
<div id="includes-list">
<span class="include-name">Singleton</span>
</div>
</div>
<div id="section">
<div id="attribute-list">
<h3 class="section-bar">Attributes</h3>
<div class="name-list">
<table>
<tr class="top-aligned-row context-row">
<td class="context-item-name">db</td>
<td class="context-item-value"> [R] </td>
<td class="context-item-desc"></td>
</tr>
<tr class="top-aligned-row context-row">
<td class="context-item-name">eventmgr</td>
<td class="context-item-value"> [R] </td>
<td class="context-item-desc"></td>
</tr>
<tr class="top-aligned-row context-row">
<td class="context-item-name">shutdown</td>
<td class="context-item-value"> [RW] </td>
<td class="context-item-desc"></td>
</tr>
<tr class="top-aligned-row context-row">
<td class="context-item-name">world</td>
<td class="context-item-value"> [R] </td>
<td class="context-item-desc"></td>
</tr>
</table>
</div>
</div>
<!-- if method_list -->
<div id="methods">
<h3 class="section-bar">Public Class methods</h3>
<div id="method-M000045" class="method-detail">
<a name="M000045"></a>
<div class="method-heading">
<a href="Engine.src/M000045.html" target="Code" class="method-signature"
onclick="popupCode('Engine.src/M000045.html');return false;">
<span class="method-name">new</span><span class="method-args">()</span>
</a>
</div>
<div class="method-description">
<p>
Create the an engine.
</p>
<dl>
<dt><tt>return</tt></dt><dd>A handle to the engine.
</dd>
</dl>
</div>
</div>
<h3 class="section-bar">Public Instance methods</h3>
<div id="method-M000049" class="method-detail">
<a name="M000049"></a>
<div class="method-heading">
<a href="Engine.src/M000049.html" target="Code" class="method-signature"
onclick="popupCode('Engine.src/M000049.html');return false;">
<span class="method-name">graceful_shutdown</span><span class="method-args">()</span>
</a>
</div>
<div class="method-description">
</div>
</div>
<div id="method-M000048" class="method-detail">
<a name="M000048"></a>
<div class="method-heading">
<a href="Engine.src/M000048.html" target="Code" class="method-signature"
onclick="popupCode('Engine.src/M000048.html');return false;">
<span class="method-name">handle_signal</span><span class="method-args">(sig)</span>
</a>
</div>
<div class="method-description">
<p>
Setup traps - invoke one of these signals to shut down the mud
</p>
</div>
</div>
<div id="method-M000046" class="method-detail">
<a name="M000046"></a>
<div class="method-heading">
<a href="Engine.src/M000046.html" target="Code" class="method-signature"
onclick="popupCode('Engine.src/M000046.html');return false;">
<span class="method-name">run</span><span class="method-args">()</span>
</a>
</div>
<div class="method-description">
<p>
main loop to run engine.
</p>
<table>
<tr><td valign="top">note:</td><td>@shutdown never set by anyone yet
</td></tr>
</table>
</div>
</div>
<div id="method-M000047" class="method-detail">
<a name="M000047"></a>
<div class="method-heading">
<a href="Engine.src/M000047.html" target="Code" class="method-signature"
onclick="popupCode('Engine.src/M000047.html');return false;">
<span class="method-name">update</span><span class="method-args">(newconn)</span>
</a>
</div>
<div class="method-description">
<p>
Update is called by an acceptor passing us a new session. We create an
incoming object and set it and the connection to watch each other.
</p>
</div>
</div>
</div>
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html>