documentation updates for Rubyforge death
[rainbows.git] / lib / rainbows / coolio_thread_spawn.rb
blob2e305a45b9da18101d0c23aad3e367eebe1a8b4f
1 # -*- encoding: binary -*-
2 # A combination of the Coolio and ThreadSpawn models.  This allows Ruby
3 # Thread-based concurrency for application processing.  It DOES NOT
4 # expose a streamable "rack.input" for upload processing within the
5 # app.  DevFdResponse should be used with this class to proxy
6 # asynchronous responses.  All network I/O between the client and
7 # server are handled by the main thread and outside of the core
8 # application dispatch.
10 # Unlike ThreadSpawn, Cool.io makes this model highly suitable for
11 # slow clients and applications with medium-to-slow response times
12 # (I/O bound), but less suitable for sleepy applications.
14 # This concurrency model is designed for Ruby 1.9, and Ruby 1.8
15 # users are NOT advised to use this due to high CPU usage.
17 # === RubyGem Requirements
18 # * cool.io 1.0.0 or later
19 module Rainbows::CoolioThreadSpawn
20   include Rainbows::Coolio::Core
21   autoload :Client, 'rainbows/coolio_thread_spawn/client'
23   def init_worker_process(worker) # :nodoc:
24     super
25     master = Rainbows::Coolio::Master.new(Queue.new)
26     master.attach(Coolio::Loop.default)
27     Client.const_set(:MASTER, master)
28   end
29 end
30 # :enddoc: