rainbows 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/GIT-VERSION-GEN +1 -2
- data/GNUmakefile +5 -1
- data/LICENSE +2 -2
- data/README +23 -11
- data/Rakefile +18 -2
- data/lib/rainbows/base.rb +3 -4
- data/lib/rainbows/const.rb +1 -1
- data/lib/rainbows/thread_pool.rb +5 -8
- data/lib/rainbows/thread_spawn.rb +3 -5
- data/local.mk.sample +12 -5
- data/rainbows.gemspec +2 -2
- data/t/GNUmakefile +4 -1
- data/t/t0000-basic.sh +3 -10
- data/t/t0000.ru +3 -0
- data/t/t1000-thread-pool-basic.sh +6 -16
- data/t/t1000.ru +6 -0
- data/t/t2000-thread-spawn-basic.sh +6 -16
- data/t/t2000.ru +6 -0
- data/t/t3000-revactor-basic.sh +6 -16
- data/t/t3000.ru +6 -0
- data/t/t3100-revactor-tee-input.sh +1 -1
- data/t/test-lib.sh +1 -1
- metadata +20 -9
    
        data/GIT-VERSION-GEN
    CHANGED
    
    
    
        data/GNUmakefile
    CHANGED
    
    
    
        data/LICENSE
    CHANGED
    
    | @@ -1,5 +1,5 @@ | |
| 1 | 
            -
            \Rainbows! is copyrighted  | 
| 2 | 
            -
             | 
| 1 | 
            +
            \Rainbows! is copyrighted Free Software by all contributors, see the
         | 
| 2 | 
            +
            logs in revision control for all of them.  You can redistribute it
         | 
| 3 3 | 
             
            and/or modify it under either the terms of the
         | 
| 4 4 | 
             
            {GPL2}[http://www.gnu.org/licenses/gpl-2.0.txt] (see link:COPYING) or
         | 
| 5 5 | 
             
            the conditions below:
         | 
    
        data/README
    CHANGED
    
    | @@ -1,11 +1,10 @@ | |
| 1 | 
            -
            = Rainbows! Unicorn for  | 
| 1 | 
            +
            = Rainbows! Unicorn for sleepy apps and slow clients
         | 
| 2 2 |  | 
| 3 | 
            -
             | 
| 4 | 
            -
            applications | 
| 5 | 
            -
             | 
| 6 | 
            -
             | 
| 7 | 
            -
             | 
| 8 | 
            -
            easier to debug.
         | 
| 3 | 
            +
            Rainbows! is a HTTP server for sleepy Rack applications.  It is based on
         | 
| 4 | 
            +
            Unicorn, but designed to handle applications that expect long
         | 
| 5 | 
            +
            request/response times and/or slow clients.  For Rack applications not
         | 
| 6 | 
            +
            heavily bound by slow external network dependencies, consider Unicorn
         | 
| 7 | 
            +
            instead as it simpler and easier to debug.
         | 
| 9 8 |  | 
| 10 9 | 
             
            == \Rainbows! is about Diversity
         | 
| 11 10 |  | 
| @@ -24,9 +23,11 @@ CPU/memory/disk concurrency. | |
| 24 23 |  | 
| 25 24 | 
             
            == Features
         | 
| 26 25 |  | 
| 27 | 
            -
            * Designed for Rack, the standard for | 
| 26 | 
            +
            * Designed for {Rack}[http://rack.rubyforge.org/], the standard for
         | 
| 27 | 
            +
              modern Ruby HTTP applications.
         | 
| 28 28 |  | 
| 29 | 
            -
            * Built on Unicorn, inheriting its | 
| 29 | 
            +
            * Built on {Unicorn}[http://unicorn.bogomips.org/], inheriting its
         | 
| 30 | 
            +
              process/socket management features
         | 
| 30 31 | 
             
              such as transparent upgrades and Ruby configuration DSL.
         | 
| 31 32 |  | 
| 32 33 | 
             
            * As with Unicorn, it is able to stream large request bodies off the
         | 
| @@ -55,8 +56,8 @@ CPU/memory/disk concurrency. | |
| 55 56 |  | 
| 56 57 | 
             
            == License
         | 
| 57 58 |  | 
| 58 | 
            -
            \Rainbows! is copyright 2009  | 
| 59 | 
            -
            Mongrel and Unicorn and carries the same license.
         | 
| 59 | 
            +
            \Rainbows! is copyright 2009 by all contributors (see logs in git).
         | 
| 60 | 
            +
            It is based on Mongrel and Unicorn and carries the same license.
         | 
| 60 61 |  | 
| 61 62 | 
             
            Mongrel is copyright 2007 Zed A. Shaw and contributors. It is licensed
         | 
| 62 63 | 
             
            under the Ruby license and the GPL2. See the included LICENSE file for
         | 
| @@ -64,6 +65,17 @@ details. | |
| 64 65 |  | 
| 65 66 | 
             
            \Rainbows! is 100% Free Software.
         | 
| 66 67 |  | 
| 68 | 
            +
            == Install
         | 
| 69 | 
            +
             | 
| 70 | 
            +
            You may download the tarball from the Rainbows project page on Rubyforge
         | 
| 71 | 
            +
            and run setup.rb after unpacking it:
         | 
| 72 | 
            +
             | 
| 73 | 
            +
            http://rubyforge.org/frs/?group_id=8977
         | 
| 74 | 
            +
             | 
| 75 | 
            +
            You may also install it via Rubygems on Rubyforge:
         | 
| 76 | 
            +
             | 
| 77 | 
            +
              gem install rainbows
         | 
| 78 | 
            +
             | 
| 67 79 | 
             
            == Usage
         | 
| 68 80 |  | 
| 69 81 | 
             
            === for Rack applications
         | 
    
        data/Rakefile
    CHANGED
    
    | @@ -33,7 +33,7 @@ task :news_atom do | |
| 33 33 | 
             
                feed :xmlns => "http://www.w3.org/2005/Atom" do
         | 
| 34 34 | 
             
                  id! "http://rainbows.rubyforge.org/NEWS.atom.xml"
         | 
| 35 35 | 
             
                  title "Rainbows! news"
         | 
| 36 | 
            -
                  subtitle "Unicorn for  | 
| 36 | 
            +
                  subtitle "Unicorn for sleepy apps and slow clients"
         | 
| 37 37 | 
             
                  link! :rel => 'alternate', :type => 'text/html',
         | 
| 38 38 | 
             
                        :href => 'http://rainbows.rubyforge.org/NEWS.html'
         | 
| 39 39 | 
             
                  updated(new_tags.empty? ? "1970-01-01T00:00:00Z" : new_tags.first[:time])
         | 
| @@ -64,7 +64,7 @@ task :news_rdoc do | |
| 64 64 | 
             
                puts ""
         | 
| 65 65 |  | 
| 66 66 | 
             
                body = tag[:body]
         | 
| 67 | 
            -
                puts tag[:body].gsub(/^/sm, "  ").gsub | 
| 67 | 
            +
                puts tag[:body].gsub(/^/sm, "  ").gsub(/[ \t]+$/sm, "")
         | 
| 68 68 | 
             
                puts ""
         | 
| 69 69 | 
             
              end
         | 
| 70 70 | 
             
            end
         | 
| @@ -101,3 +101,19 @@ task :release_notes do | |
| 101 101 | 
             
              print "\nChanges:\n\n"
         | 
| 102 102 | 
             
              puts body
         | 
| 103 103 | 
             
            end
         | 
| 104 | 
            +
             | 
| 105 | 
            +
            desc "read news article from STDIN and post to rubyforge"
         | 
| 106 | 
            +
            task :publish_news do
         | 
| 107 | 
            +
              require 'rubyforge'
         | 
| 108 | 
            +
              IO.select([STDIN], nil, nil, 1) or abort "E: news must be read from stdin"
         | 
| 109 | 
            +
              msg = STDIN.readlines
         | 
| 110 | 
            +
              subject = msg.shift
         | 
| 111 | 
            +
              blank = msg.shift
         | 
| 112 | 
            +
              blank == "\n" or abort "no newline after subject!"
         | 
| 113 | 
            +
              subject.strip!
         | 
| 114 | 
            +
              body = msg.join("").strip!
         | 
| 115 | 
            +
             | 
| 116 | 
            +
              rf = RubyForge.new.configure
         | 
| 117 | 
            +
              rf.login
         | 
| 118 | 
            +
              rf.post_news('rainbows', subject, body)
         | 
| 119 | 
            +
            end
         | 
    
        data/lib/rainbows/base.rb
    CHANGED
    
    | @@ -24,7 +24,8 @@ module Rainbows | |
| 24 24 | 
             
                  env = {}
         | 
| 25 25 | 
             
                  remote_addr = TCPSocket === client ? client.peeraddr.last : LOCALHOST
         | 
| 26 26 |  | 
| 27 | 
            -
                  begin
         | 
| 27 | 
            +
                  begin # loop
         | 
| 28 | 
            +
                    Thread.current[:t] = Time.now
         | 
| 28 29 | 
             
                    while ! hp.headers(env, buf)
         | 
| 29 30 | 
             
                      buf << client.readpartial(CHUNK_SIZE)
         | 
| 30 31 | 
             
                    end
         | 
| @@ -60,9 +61,7 @@ module Rainbows | |
| 60 61 | 
             
                end
         | 
| 61 62 |  | 
| 62 63 | 
             
                def self.included(klass)
         | 
| 63 | 
            -
                   | 
| 64 | 
            -
                    klass.const_set(x, HttpServer.const_get(x))
         | 
| 65 | 
            -
                  end
         | 
| 64 | 
            +
                  klass.const_set :LISTENERS, HttpServer::LISTENERS
         | 
| 66 65 | 
             
                end
         | 
| 67 66 |  | 
| 68 67 | 
             
              end
         | 
    
        data/lib/rainbows/const.rb
    CHANGED
    
    
    
        data/lib/rainbows/thread_pool.rb
    CHANGED
    
    | @@ -26,11 +26,11 @@ module Rainbows | |
| 26 26 |  | 
| 27 27 | 
             
                  # closing anything we IO.select on will raise EBADF
         | 
| 28 28 | 
             
                  trap(:USR1) { reopen_worker_logs(worker.nr) rescue nil }
         | 
| 29 | 
            -
                  trap(:QUIT) {  | 
| 29 | 
            +
                  trap(:QUIT) { LISTENERS.map! { |s| s.close rescue nil } }
         | 
| 30 30 | 
             
                  [:TERM, :INT].each { |sig| trap(sig) { exit(0) } } # instant shutdown
         | 
| 31 31 | 
             
                  logger.info "worker=#{worker.nr} ready with ThreadPool"
         | 
| 32 32 |  | 
| 33 | 
            -
                  while  | 
| 33 | 
            +
                  while LISTENERS.first && master_pid == Process.ppid
         | 
| 34 34 | 
             
                    maintain_thread_count(threads)
         | 
| 35 35 | 
             
                    threads.list.each do |thr|
         | 
| 36 36 | 
             
                      alive.chmod(nr += 1)
         | 
| @@ -65,11 +65,9 @@ module Rainbows | |
| 65 65 |  | 
| 66 66 | 
             
                def new_worker_thread
         | 
| 67 67 | 
             
                  Thread.new {
         | 
| 68 | 
            -
                    alive = true
         | 
| 69 | 
            -
                    thr = Thread.current
         | 
| 70 68 | 
             
                    begin
         | 
| 71 69 | 
             
                      ret = begin
         | 
| 72 | 
            -
                         | 
| 70 | 
            +
                        Thread.current[:t] = Time.now
         | 
| 73 71 | 
             
                        IO.select(LISTENERS, nil, nil, timeout/2.0) or next
         | 
| 74 72 | 
             
                      rescue Errno::EINTR
         | 
| 75 73 | 
             
                        retry
         | 
| @@ -79,16 +77,15 @@ module Rainbows | |
| 79 77 | 
             
                      ret.first.each do |sock|
         | 
| 80 78 | 
             
                        begin
         | 
| 81 79 | 
             
                          process_client(sock.accept_nonblock)
         | 
| 82 | 
            -
                          thr[:t] = Time.now
         | 
| 83 80 | 
             
                        rescue Errno::EAGAIN, Errno::ECONNABORTED
         | 
| 84 81 | 
             
                        end
         | 
| 85 82 | 
             
                      end
         | 
| 86 83 | 
             
                    rescue Object => e
         | 
| 87 | 
            -
                      if  | 
| 84 | 
            +
                      if LISTENERS.first
         | 
| 88 85 | 
             
                        logger.error "Unhandled listen loop exception #{e.inspect}."
         | 
| 89 86 | 
             
                        logger.error e.backtrace.join("\n")
         | 
| 90 87 | 
             
                      end
         | 
| 91 | 
            -
                    end while  | 
| 88 | 
            +
                    end while LISTENERS.first
         | 
| 92 89 | 
             
                  }
         | 
| 93 90 | 
             
                end
         | 
| 94 91 |  | 
| @@ -22,12 +22,13 @@ module Rainbows | |
| 22 22 |  | 
| 23 23 | 
             
                  # closing anything we IO.select on will raise EBADF
         | 
| 24 24 | 
             
                  trap(:USR1) { reopen_worker_logs(worker.nr) rescue nil }
         | 
| 25 | 
            -
                  trap(:QUIT) {  | 
| 25 | 
            +
                  trap(:QUIT) { LISTENERS.map! { |s| s.close rescue nil } }
         | 
| 26 26 | 
             
                  [:TERM, :INT].each { |sig| trap(sig) { exit(0) } } # instant shutdown
         | 
| 27 27 | 
             
                  logger.info "worker=#{worker.nr} ready with ThreadSpawn"
         | 
| 28 28 |  | 
| 29 29 | 
             
                  while alive && master_pid == Process.ppid
         | 
| 30 30 | 
             
                    ret = begin
         | 
| 31 | 
            +
                      alive.chmod(nr += 1)
         | 
| 31 32 | 
             
                      IO.select(LISTENERS, nil, nil, timeout/2.0) or next
         | 
| 32 33 | 
             
                    rescue Errno::EINTR
         | 
| 33 34 | 
             
                      retry
         | 
| @@ -44,10 +45,7 @@ module Rainbows | |
| 44 45 | 
             
                      rescue Errno::EINTR, Errno::ECONNABORTED
         | 
| 45 46 | 
             
                        next
         | 
| 46 47 | 
             
                      end
         | 
| 47 | 
            -
                      threads.add(Thread.new(c) { |c|
         | 
| 48 | 
            -
                        Thread.current[:t] = Time.now
         | 
| 49 | 
            -
                        process_client(c)
         | 
| 50 | 
            -
                      })
         | 
| 48 | 
            +
                      threads.add(Thread.new(c) { |c| process_client(c) })
         | 
| 51 49 | 
             
                    end
         | 
| 52 50 | 
             
                  end
         | 
| 53 51 | 
             
                  join_spawned_threads(threads)
         | 
    
        data/local.mk.sample
    CHANGED
    
    | @@ -5,17 +5,24 @@ | |
| 5 5 | 
             
            # This is depends on a bunch of GNU-isms from bash, sed, touch.
         | 
| 6 6 |  | 
| 7 7 | 
             
            DLEXT := so
         | 
| 8 | 
            -
             | 
| 8 | 
            +
            gems := rev-0.3.0 rack-1.0.0 iobuffer-0.1.1
         | 
| 9 9 |  | 
| 10 10 | 
             
            # Avoid loading rubygems to speed up tests because gmake is
         | 
| 11 11 | 
             
            # fork+exec heavy with Ruby.
         | 
| 12 12 | 
             
            ifeq ($(r19),)
         | 
| 13 13 | 
             
              ruby := $(HOME)/bin/ruby
         | 
| 14 | 
            -
               | 
| 14 | 
            +
              gem_paths := $(addprefix $(HOME)/lib/ruby/gems/1.8/gems/,$(gems))
         | 
| 15 15 | 
             
            else
         | 
| 16 16 | 
             
              export PATH := $(HOME)/ruby-1.9/bin:$(PATH)
         | 
| 17 17 | 
             
              ruby := $(HOME)/ruby-1.9/bin/ruby --disable-gems
         | 
| 18 | 
            -
               | 
| 18 | 
            +
              gems := $(gems) case-0.5 revactor-0.1.4
         | 
| 19 | 
            +
              gem_paths := $(addprefix $(HOME)/ruby-1.9/lib/ruby/gems/1.9.1/gems/,$(gems))
         | 
| 20 | 
            +
            endif
         | 
| 21 | 
            +
             | 
| 22 | 
            +
            ifdef gem_paths
         | 
| 23 | 
            +
              sp :=
         | 
| 24 | 
            +
              sp +=
         | 
| 25 | 
            +
              RUBYLIB := $(subst $(sp),:,$(addsuffix /lib,$(gem_paths)))
         | 
| 19 26 | 
             
            endif
         | 
| 20 27 |  | 
| 21 28 | 
             
            # pipefail is THE reason to use bash (v3+)
         | 
| @@ -23,9 +30,9 @@ SHELL := /bin/bash -e -o pipefail | |
| 23 30 |  | 
| 24 31 | 
             
            full-test: test-18 test-19
         | 
| 25 32 | 
             
            test-18:
         | 
| 26 | 
            -
            	$(MAKE) test  | 
| 33 | 
            +
            	$(MAKE) test 2>&1 | sed -u -e 's!^!1.8 !'
         | 
| 27 34 | 
             
            test-19:
         | 
| 28 | 
            -
            	$(MAKE) test  | 
| 35 | 
            +
            	$(MAKE) test r19=t 2>&1 | sed -u -e 's!^!1.9 !'
         | 
| 29 36 |  | 
| 30 37 | 
             
            latest: NEWS
         | 
| 31 38 | 
             
            	@awk 'BEGIN{RS="=== ";ORS=""}NR==2{sub(/\n$$/,"");print RS""$$0 }' < $<
         | 
    
        data/rainbows.gemspec
    CHANGED
    
    | @@ -14,7 +14,7 @@ Gem::Specification.new do |s| | |
| 14 14 | 
             
              s.name = %q{rainbows}
         | 
| 15 15 | 
             
              s.version = ENV["VERSION"]
         | 
| 16 16 |  | 
| 17 | 
            -
              s.authors = [" | 
| 17 | 
            +
              s.authors = ["Rainbows! developers"]
         | 
| 18 18 | 
             
              s.date = Time.now.utc.strftime('%Y-%m-%d')
         | 
| 19 19 | 
             
              s.description = File.read("README").split(/\n\n/)[1]
         | 
| 20 20 | 
             
              s.email = %q{rainbows-talk@rubyforge.org}
         | 
| @@ -33,7 +33,7 @@ Gem::Specification.new do |s| | |
| 33 33 |  | 
| 34 34 | 
             
              s.files = manifest
         | 
| 35 35 | 
             
              s.homepage = %q{http://rainbows.rubyforge.org/}
         | 
| 36 | 
            -
              s.summary = %q{Unicorn for  | 
| 36 | 
            +
              s.summary = %q{Unicorn for sleepy apps and slow clients}
         | 
| 37 37 | 
             
              s.rdoc_options = [ "-Na", "-t", "Rainbows! #{s.summary}" ]
         | 
| 38 38 | 
             
              s.require_paths = %w(lib)
         | 
| 39 39 | 
             
              s.rubyforge_project = %q{rainbows}
         | 
    
        data/t/GNUmakefile
    CHANGED
    
    | @@ -37,6 +37,9 @@ ifndef V | |
| 37 37 | 
             
              quiet_post = > $(t_log) 2>&1; exit $$(cat $(t_code))
         | 
| 38 38 | 
             
              pfx =
         | 
| 39 39 | 
             
            else
         | 
| 40 | 
            +
              ifeq ($(V),2)
         | 
| 41 | 
            +
                TEST_OPTS += -x
         | 
| 42 | 
            +
              endif
         | 
| 40 43 | 
             
              quiet_pre = @echo '* $@';
         | 
| 41 44 | 
             
              quiet_post = 2>&1 | tee $(t_log); exit $$(cat $(t_code))
         | 
| 42 45 | 
             
              pfx = $@
         | 
| @@ -50,7 +53,7 @@ test-bin-$(RUBY_VERSION)/rainbows: ../bin/rainbows | |
| 50 53 | 
             
            	mkdir -p $(@D)
         | 
| 51 54 | 
             
            	install -m 755 $^ $@+
         | 
| 52 55 | 
             
            	$(ruby) -i -p -e '$$_.gsub!(%r{^#!.*$$},"#!$(ruby_bin)")' $@+
         | 
| 53 | 
            -
            	cmp $@+ $@ || mv $@+ $@
         | 
| 56 | 
            +
            	cmp $@+ $@ 2>/dev/null || mv $@+ $@
         | 
| 54 57 | 
             
            	$(RM) $@+
         | 
| 55 58 |  | 
| 56 59 | 
             
            $(T): export ruby := $(ruby)
         | 
    
        data/t/t0000-basic.sh
    CHANGED
    
    | @@ -2,17 +2,10 @@ | |
| 2 2 | 
             
            . ./test-lib.sh
         | 
| 3 3 |  | 
| 4 4 | 
             
            eval $(unused_listen)
         | 
| 5 | 
            -
             | 
| 6 | 
            -
             | 
| 7 | 
            -
            TEST_RM_LIST="$TEST_RM_LIST $config_ru $lock_path"
         | 
| 5 | 
            +
            pid=$(mktemp -t rainbows.$$.pid.XXXXXXXX)
         | 
| 6 | 
            +
            TEST_RM_LIST="$TEST_RM_LIST $lock_path $pid"
         | 
| 8 7 |  | 
| 9 | 
            -
             | 
| 10 | 
            -
            use Rack::ContentLength
         | 
| 11 | 
            -
            use Rack::ContentType
         | 
| 12 | 
            -
            run lambda { |env| [ 200, {}, [ env.inspect << "\n" ] ] }
         | 
| 13 | 
            -
            EOF
         | 
| 14 | 
            -
             | 
| 15 | 
            -
            rainbows $config_ru -l $listen --pid $pid &
         | 
| 8 | 
            +
            rainbows t0000.ru -l $listen --pid $pid &
         | 
| 16 9 | 
             
            wait_for_pid $pid
         | 
| 17 10 | 
             
            curl -sSfv http://$listen/
         | 
| 18 11 | 
             
            kill $(cat $pid)
         | 
    
        data/t/t0000.ru
    ADDED
    
    
| @@ -2,23 +2,13 @@ | |
| 2 2 | 
             
            . ./test-lib.sh
         | 
| 3 3 |  | 
| 4 4 | 
             
            eval $(unused_listen)
         | 
| 5 | 
            -
             | 
| 6 | 
            -
             | 
| 7 | 
            -
             | 
| 8 | 
            -
             | 
| 9 | 
            -
             | 
| 10 | 
            -
            TEST_RM_LIST="$TEST_RM_LIST $config_ru $unicorn_config $lock_path"
         | 
| 5 | 
            +
            unicorn_config=$(mktemp -t rainbows.$$.unicorn.rb.XXXXXXXX)
         | 
| 6 | 
            +
            curl_out=$(mktemp -t rainbows.$$.curl.out.XXXXXXXX)
         | 
| 7 | 
            +
            curl_err=$(mktemp -t rainbows.$$.curl.err.XXXXXXXX)
         | 
| 8 | 
            +
            pid=$(mktemp -t rainbows.$$.pid.XXXXXXXX)
         | 
| 9 | 
            +
            TEST_RM_LIST="$TEST_RM_LIST $unicorn_config $lock_path $pid"
         | 
| 11 10 | 
             
            TEST_RM_LIST="$TEST_RM_LIST $curl_out $curl_err"
         | 
| 12 11 |  | 
| 13 | 
            -
            cat > $config_ru <<\EOF
         | 
| 14 | 
            -
            use Rack::ContentLength
         | 
| 15 | 
            -
            use Rack::ContentType
         | 
| 16 | 
            -
            run lambda { |env|
         | 
| 17 | 
            -
              sleep 1
         | 
| 18 | 
            -
              [ 200, {}, [ Thread.current.inspect << "\n" ] ]
         | 
| 19 | 
            -
            }
         | 
| 20 | 
            -
            EOF
         | 
| 21 | 
            -
             | 
| 22 12 | 
             
            nr_client=30
         | 
| 23 13 | 
             
            nr_thread=10
         | 
| 24 14 |  | 
| @@ -31,7 +21,7 @@ Rainbows! do | |
| 31 21 | 
             
            end
         | 
| 32 22 | 
             
            EOF
         | 
| 33 23 |  | 
| 34 | 
            -
            rainbows -D  | 
| 24 | 
            +
            rainbows -D t1000.ru -c $unicorn_config
         | 
| 35 25 | 
             
            wait_for_pid $pid
         | 
| 36 26 |  | 
| 37 27 | 
             
            start=$(date +%s)
         | 
    
        data/t/t1000.ru
    ADDED
    
    
| @@ -2,23 +2,13 @@ | |
| 2 2 | 
             
            . ./test-lib.sh
         | 
| 3 3 |  | 
| 4 4 | 
             
            eval $(unused_listen)
         | 
| 5 | 
            -
             | 
| 6 | 
            -
             | 
| 7 | 
            -
             | 
| 8 | 
            -
             | 
| 9 | 
            -
             | 
| 10 | 
            -
            TEST_RM_LIST="$TEST_RM_LIST $config_ru $unicorn_config $lock_path"
         | 
| 5 | 
            +
            unicorn_config=$(mktemp -t rainbows.$$.unicorn.rb.XXXXXXXX)
         | 
| 6 | 
            +
            curl_out=$(mktemp -t rainbows.$$.curl.out.XXXXXXXX)
         | 
| 7 | 
            +
            curl_err=$(mktemp -t rainbows.$$.curl.err.XXXXXXXX)
         | 
| 8 | 
            +
            pid=$(mktemp -t rainbows.$$.pid.XXXXXXXX)
         | 
| 9 | 
            +
            TEST_RM_LIST="$TEST_RM_LIST $unicorn_config $lock_path $pid"
         | 
| 11 10 | 
             
            TEST_RM_LIST="$TEST_RM_LIST $curl_out $curl_err"
         | 
| 12 11 |  | 
| 13 | 
            -
            cat > $config_ru <<\EOF
         | 
| 14 | 
            -
            use Rack::ContentLength
         | 
| 15 | 
            -
            use Rack::ContentType
         | 
| 16 | 
            -
            run lambda { |env|
         | 
| 17 | 
            -
              sleep 1
         | 
| 18 | 
            -
              [ 200, {}, [ Thread.current.inspect << "\n" ] ]
         | 
| 19 | 
            -
            }
         | 
| 20 | 
            -
            EOF
         | 
| 21 | 
            -
             | 
| 22 12 | 
             
            nr_client=30
         | 
| 23 13 | 
             
            nr_thread=10
         | 
| 24 14 |  | 
| @@ -31,7 +21,7 @@ Rainbows! do | |
| 31 21 | 
             
            end
         | 
| 32 22 | 
             
            EOF
         | 
| 33 23 |  | 
| 34 | 
            -
            rainbows -D  | 
| 24 | 
            +
            rainbows -D t2000.ru -c $unicorn_config
         | 
| 35 25 | 
             
            wait_for_pid $pid
         | 
| 36 26 |  | 
| 37 27 | 
             
            start=$(date +%s)
         | 
    
        data/t/t2000.ru
    ADDED
    
    
    
        data/t/t3000-revactor-basic.sh
    CHANGED
    
    | @@ -3,23 +3,13 @@ | |
| 3 3 | 
             
            require_revactor
         | 
| 4 4 |  | 
| 5 5 | 
             
            eval $(unused_listen)
         | 
| 6 | 
            -
             | 
| 7 | 
            -
             | 
| 8 | 
            -
             | 
| 9 | 
            -
             | 
| 10 | 
            -
            pid | 
| 11 | 
            -
            TEST_RM_LIST="$TEST_RM_LIST $config_ru $unicorn_config $lock_path"
         | 
| 6 | 
            +
            unicorn_config=$(mktemp -t rainbows.$$.unicorn.rb.XXXXXXXX)
         | 
| 7 | 
            +
            curl_out=$(mktemp -t rainbows.$$.curl.out.XXXXXXXX)
         | 
| 8 | 
            +
            curl_err=$(mktemp -t rainbows.$$.curl.err.XXXXXXXX)
         | 
| 9 | 
            +
            pid=$(mktemp -t rainbows.$$.pid.XXXXXXXX)
         | 
| 10 | 
            +
            TEST_RM_LIST="$TEST_RM_LIST $pid $unicorn_config $lock_path"
         | 
| 12 11 | 
             
            TEST_RM_LIST="$TEST_RM_LIST $curl_out $curl_err"
         | 
| 13 12 |  | 
| 14 | 
            -
            cat > $config_ru <<\EOF
         | 
| 15 | 
            -
            use Rack::ContentLength
         | 
| 16 | 
            -
            use Rack::ContentType
         | 
| 17 | 
            -
            run lambda { |env|
         | 
| 18 | 
            -
              Actor.sleep 1
         | 
| 19 | 
            -
              [ 200, {}, [ Thread.current.inspect << "\n" ] ]
         | 
| 20 | 
            -
            }
         | 
| 21 | 
            -
            EOF
         | 
| 22 | 
            -
             | 
| 23 13 | 
             
            nr_client=30
         | 
| 24 14 | 
             
            nr_actor=10
         | 
| 25 15 |  | 
| @@ -32,7 +22,7 @@ Rainbows! do | |
| 32 22 | 
             
            end
         | 
| 33 23 | 
             
            EOF
         | 
| 34 24 |  | 
| 35 | 
            -
            rainbows -D  | 
| 25 | 
            +
            rainbows -D t3000.ru -c $unicorn_config
         | 
| 36 26 | 
             
            wait_for_pid $pid
         | 
| 37 27 |  | 
| 38 28 | 
             
            start=$(date +%s)
         | 
    
        data/t/t3000.ru
    ADDED
    
    
| @@ -14,7 +14,7 @@ r_out=$(mktemp -t rainbows.$$.r.out.XXXXXXXX) | |
| 14 14 | 
             
            pid=$(mktemp -t rainbows.$$.pid.XXXXXXXX)
         | 
| 15 15 | 
             
            blob=$(mktemp -t rainbows.$$.blob.XXXXXXXX)
         | 
| 16 16 | 
             
            TEST_RM_LIST="$TEST_RM_LIST $unicorn_config $lock_path $r_err $r_out"
         | 
| 17 | 
            -
            TEST_RM_LIST="$TEST_RM_LIST $curl_out $curl_err $blob"
         | 
| 17 | 
            +
            TEST_RM_LIST="$TEST_RM_LIST $curl_out $curl_err $blob $pid"
         | 
| 18 18 |  | 
| 19 19 | 
             
            cat > $unicorn_config <<EOF
         | 
| 20 20 | 
             
            listen "$listen"
         | 
    
        data/t/test-lib.sh
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,15 +1,15 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification 
         | 
| 2 2 | 
             
            name: rainbows
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version 
         | 
| 4 | 
            -
              version: 0.1. | 
| 4 | 
            +
              version: 0.1.1
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors: 
         | 
| 7 | 
            -
            -  | 
| 7 | 
            +
            - Rainbows! developers
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 11 |  | 
| 12 | 
            -
            date: 2009-10- | 
| 12 | 
            +
            date: 2009-10-06 00:00:00 -07:00
         | 
| 13 13 | 
             
            default_executable: 
         | 
| 14 14 | 
             
            dependencies: 
         | 
| 15 15 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| @@ -32,7 +32,12 @@ dependencies: | |
| 32 32 | 
             
                  - !ruby/object:Gem::Version 
         | 
| 33 33 | 
             
                    version: 0.93.1
         | 
| 34 34 | 
             
                version: 
         | 
| 35 | 
            -
            description:  | 
| 35 | 
            +
            description: |-
         | 
| 36 | 
            +
              Rainbows! is a HTTP server for sleepy Rack applications.  It is based on
         | 
| 37 | 
            +
              Unicorn, but designed to handle applications that expect long
         | 
| 38 | 
            +
              request/response times and/or slow clients.  For Rack applications not
         | 
| 39 | 
            +
              heavily bound by slow external network dependencies, consider Unicorn
         | 
| 40 | 
            +
              instead as it simpler and easier to debug.
         | 
| 36 41 | 
             
            email: rainbows-talk@rubyforge.org
         | 
| 37 42 | 
             
            executables: 
         | 
| 38 43 | 
             
            - rainbows
         | 
| @@ -97,19 +102,25 @@ files: | |
| 97 102 | 
             
            - t/bin/unused_listen
         | 
| 98 103 | 
             
            - t/sha1.ru
         | 
| 99 104 | 
             
            - t/t0000-basic.sh
         | 
| 105 | 
            +
            - t/t0000.ru
         | 
| 100 106 | 
             
            - t/t1000-thread-pool-basic.sh
         | 
| 107 | 
            +
            - t/t1000.ru
         | 
| 101 108 | 
             
            - t/t2000-thread-spawn-basic.sh
         | 
| 109 | 
            +
            - t/t2000.ru
         | 
| 102 110 | 
             
            - t/t3000-revactor-basic.sh
         | 
| 111 | 
            +
            - t/t3000.ru
         | 
| 103 112 | 
             
            - t/t3100-revactor-tee-input.sh
         | 
| 104 113 | 
             
            - t/test-lib.sh
         | 
| 105 114 | 
             
            - vs_Unicorn
         | 
| 106 | 
            -
            has_rdoc:  | 
| 115 | 
            +
            has_rdoc: true
         | 
| 107 116 | 
             
            homepage: http://rainbows.rubyforge.org/
         | 
| 117 | 
            +
            licenses: []
         | 
| 118 | 
            +
             | 
| 108 119 | 
             
            post_install_message: 
         | 
| 109 120 | 
             
            rdoc_options: 
         | 
| 110 121 | 
             
            - -Na
         | 
| 111 122 | 
             
            - -t
         | 
| 112 | 
            -
            - Rainbows! Unicorn for  | 
| 123 | 
            +
            - Rainbows! Unicorn for sleepy apps and slow clients
         | 
| 113 124 | 
             
            require_paths: 
         | 
| 114 125 | 
             
            - lib
         | 
| 115 126 | 
             
            required_ruby_version: !ruby/object:Gem::Requirement 
         | 
| @@ -127,9 +138,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 127 138 | 
             
            requirements: []
         | 
| 128 139 |  | 
| 129 140 | 
             
            rubyforge_project: rainbows
         | 
| 130 | 
            -
            rubygems_version: 1.3. | 
| 141 | 
            +
            rubygems_version: 1.3.5
         | 
| 131 142 | 
             
            signing_key: 
         | 
| 132 | 
            -
            specification_version:  | 
| 133 | 
            -
            summary: Unicorn for  | 
| 143 | 
            +
            specification_version: 3
         | 
| 144 | 
            +
            summary: Unicorn for sleepy apps and slow clients
         | 
| 134 145 | 
             
            test_files: []
         | 
| 135 146 |  |