about summary refs log tree commit homepage
path: root/lib/rainbows.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-07-10 08:04:48 +0000
committerEric Wong <normalperson@yhbt.net>2010-07-10 08:04:48 +0000
commitd3b97d1114e2d23a9231fe889cd5bf6927d451ba (patch)
tree6c4d7a033dad1edc91b72a9e7fa36203c60c8116 /lib/rainbows.rb
parent9838b614621bbbff27a91166406d833be85adbbd (diff)
downloadrainbows-d3b97d1114e2d23a9231fe889cd5bf6927d451ba.tar.gz
Since we suck at building websites, we just rely on RDoc as a
website builder.  And since Rainbows! is an application server
(and not a programming library), our internal API should be of
little interest to end users.

Anybody interested in Rainbows! (or any other project) internals
should be reading the source.
Diffstat (limited to 'lib/rainbows.rb')
-rw-r--r--lib/rainbows.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/rainbows.rb b/lib/rainbows.rb
index 4e9578b..d0b3e8a 100644
--- a/lib/rainbows.rb
+++ b/lib/rainbows.rb
@@ -12,6 +12,7 @@ module Rainbows
   # global vars because class/instance variables are confusing me :<
   # this struct is only accessed inside workers and thus private to each
   # G.cur may not be used in the network concurrency model
+  # :stopdoc:
   class State < Struct.new(:alive,:m,:cur,:kato,:server,:tmp,:expire)
     def tick
       tmp.chmod(self.m = m == 0 ? 1 : 0)
@@ -26,7 +27,6 @@ module Rainbows
       false
     end
   end
-  # :stopdoc:
   G = State.new(true, 0, 0, 5)
   O = {}
   # :startdoc:
@@ -64,12 +64,12 @@ module Rainbows
 
     # runs the Rainbows! HttpServer with +app+ and +options+ and does
     # not return until the server has exited.
-    def run(app, options = {})
+    def run(app, options = {}) # :nodoc:
       HttpServer.new(app, options).start.join
     end
 
     # returns nil if accept fails
-    def sync_accept(sock)
+    def sync_accept(sock) # :nodoc:
       rv = sock.accept
       rv.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC)
       rv
@@ -77,7 +77,7 @@ module Rainbows
     end
 
     # returns nil if accept fails
-    def accept(sock)
+    def accept(sock) # :nodoc:
       rv = sock.accept_nonblock
       rv.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC)
       rv
@@ -87,16 +87,18 @@ module Rainbows
     # returns a string representing the address of the given client +io+
     # For local UNIX domain sockets, this will return a string referred
     # to by the (non-frozen) Unicorn::HttpRequest::LOCALHOST constant.
-    def addr(io)
+    def addr(io) # :nodoc:
       io.respond_to?(:peeraddr) ?
                         io.peeraddr[-1] : Unicorn::HttpRequest::LOCALHOST
     end
 
+    # :stopdoc:
     # the default max body size is 1 megabyte (1024 * 1024 bytes)
     @@max_bytes = 1024 * 1024
 
     def max_bytes; @@max_bytes; end
     def max_bytes=(nr); @@max_bytes = nr; end
+    # :startdoc:
   end
 
   # :stopdoc: