doc: misc cleanups and additions for RDoc
[rainbows.git] / lib / rainbows / rev_thread_spawn.rb
blobf19b68f21d295b1a682995c981a539c4ecca6902
1 # -*- encoding: binary -*-
3 # CoolioThreadPool is the new version of this, use that instead.
5 # A combination of the Rev and ThreadSpawn models.  This allows Ruby
6 # Thread-based concurrency for application processing.  It DOES NOT
7 # expose a streamable "rack.input" for upload processing within the
8 # app.  DevFdResponse should be used with this class to proxy
9 # asynchronous responses.  All network I/O between the client and
10 # server are handled by the main thread and outside of the core
11 # application dispatch.
13 # Unlike ThreadSpawn, Rev makes this model highly suitable for
14 # slow clients and applications with medium-to-slow response times
15 # (I/O bound), but less suitable for sleepy applications.
17 # This concurrency model is designed for Ruby 1.9, and Ruby 1.8
18 # users are NOT advised to use this due to high CPU usage.
19 module Rainbows::RevThreadSpawn
20   include Rainbows::Rev::Core
22   def init_worker_process(worker) # :nodoc:
23     super
24     master = Rainbows::Rev::Master.new(Queue.new).attach(Rev::Loop.default)
25     Rainbows::RevThreadSpawn::Client.const_set(:MASTER, master)
26   end
27 end
28 # :enddoc:
29 require 'rainbows/rev_thread_spawn/client'