diff options
Diffstat (limited to 'code/spyglass/docs/spyglass.html')
| -rw-r--r-- | code/spyglass/docs/spyglass.html | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/code/spyglass/docs/spyglass.html b/code/spyglass/docs/spyglass.html new file mode 100644 index 0000000..3c317a4 --- /dev/null +++ b/code/spyglass/docs/spyglass.html @@ -0,0 +1,106 @@ +<!DOCTYPE html> + +<html> +<head> + <title>Spyglass</title> + <meta http-equiv="content-type" content="text/html; charset=UTF-8"> + <meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"> + <link rel="stylesheet" media="all" href="docco.css" /> +</head> +<body> + <div id="container"> + <div id="background"></div> + + <ul class="sections"> + + + + <li id="section-1"> + <div class="annotation"> + + <div class="pilwrap for-h1"> + <a class="pilcrow" href="#section-1">¶</a> + </div> + <h1>Spyglass</h1> + + </div> + + </li> + + + <li id="section-2"> + <div class="annotation"> + + <div class="pilwrap "> + <a class="pilcrow" href="#section-2">¶</a> + </div> + <p>This is Spyglass, a Rack web server that rides on Unix designed to be simple and teach +others about Unix programming.</p> +<p>It's namesake comes from the fact that when it boots up it's nothing more than a lone socket +keeping a lookout for incoming connections. </p> +<p>When a connection comes in it spins up a Master +process which preforks some workers to actually handle http requests. If the Master process is +left idle long enough it will shut itself (and it's workers) down and go back to just a lone +listening socket, on the lookout for incoming connections.</p> +<h1>Components</h1> + + </div> + + </li> + + + <li id="section-3"> + <div class="annotation"> + + <div class="pilwrap "> + <a class="pilcrow" href="#section-3">¶</a> + </div> + <ul> +<li><p><a href="server.html">Server</a> gets the ball rolling. +The role of Server is pretty minimal. It opens the initial listening TCP socket, +then passes that socket onto the Lookout. The Lookout will actually handle reading +from the socket.</p> +</li> +<li><p><a href="lookout.html">Lookout</a> keeps a watch and notifies others when a connection +comes in. +The Lookout is a pretty 'dumb' object. All that it does is listen for incoming +connections on the socket it's given. Once it receives a connection it does a fork(2) +and invokes a Master process. The Master process actually handles the connection.</p> +</li> +<li><p><a href="master.html">Master</a> loads the application and babysits worker processes +that actually talk to clients. +The role of the Master class is to create and babysit worker processes +that will actually handle web requests. The Master itself doesn't know +anything about http, etc. it just knows how to manage processes.</p> +</li> +<li><p><a href="worker.html">Worker</a> parses HTTP, calls the app, and writes back to the client.</p> +</li> +</ul> + + </div> + + <div class="content"><div class='highlight'><pre><span class="keyword">require</span> <span class="string">'singleton'</span> +<span class="keyword">require</span> <span class="string">'socket'</span> +<span class="keyword">require</span> <span class="string">'stringio'</span> + +<span class="keyword">require</span> <span class="string">'rack/server'</span> +<span class="keyword">require</span> <span class="string">'rack/builder'</span> + +<span class="keyword">require</span> <span class="string">'spyglass_parser'</span> +<span class="keyword">require</span> <span class="string">'spyglass/configurator'</span> +<span class="keyword">require</span> <span class="string">'spyglass/logging'</span> +<span class="keyword">require</span> <span class="string">'spyglass/server'</span> +<span class="keyword">require</span> <span class="string">'spyglass/lookout'</span> +<span class="keyword">require</span> <span class="string">'spyglass/master'</span> +<span class="keyword">require</span> <span class="string">'spyglass/worker'</span> + +<span class="class"><span class="keyword">module</span> <span class="title">Spyglass</span></span> + <span class="constant">Version</span> = <span class="string">'0.1.1'</span> +<span class="keyword">end</span></pre></div></div> + + </li> + + </ul> + </div> +</body> +</html> |
