writer_thread_pool: remove unnecesary debug messages
[rainbows.git] / lib / rainbows / coolio_thread_spawn.rb
blob7ea3bdaaf101d2e4acef3297a688a145ecf150a3
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.
16 module Rainbows::CoolioThreadSpawn
17   include Rainbows::Coolio::Core
19   def init_worker_process(worker) # :nodoc:
20     super
21     master = Rainbows::Coolio::Master.new(Queue.new)
22     master.attach(Coolio::Loop.default)
23     Client.const_set(:MASTER, master)
24   end
25 end
26 # :enddoc:
27 require 'rainbows/coolio_thread_spawn/client'