rainbows 0.97.0 → 1.0.0pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. data/.manifest +14 -2
  2. data/ChangeLog +87 -118
  3. data/GIT-VERSION-FILE +1 -1
  4. data/GIT-VERSION-GEN +1 -1
  5. data/GNUmakefile +1 -1
  6. data/README +1 -1
  7. data/bin/rainbows +15 -20
  8. data/lib/rainbows/actor_spawn.rb +20 -22
  9. data/lib/rainbows/app_pool.rb +89 -93
  10. data/lib/rainbows/base.rb +4 -61
  11. data/lib/rainbows/client.rb +9 -0
  12. data/lib/rainbows/configurator.rb +37 -39
  13. data/lib/rainbows/const.rb +18 -18
  14. data/lib/rainbows/dev_fd_response.rb +2 -1
  15. data/lib/rainbows/error.rb +39 -37
  16. data/lib/rainbows/ev_core.rb +103 -109
  17. data/lib/rainbows/event_machine.rb +188 -196
  18. data/lib/rainbows/fiber/base.rb +69 -88
  19. data/lib/rainbows/fiber/io/compat.rb +13 -0
  20. data/lib/rainbows/fiber/io/methods.rb +49 -0
  21. data/lib/rainbows/fiber/io/pipe.rb +7 -0
  22. data/lib/rainbows/fiber/io/socket.rb +7 -0
  23. data/lib/rainbows/fiber/io.rb +125 -84
  24. data/lib/rainbows/fiber/rev/heartbeat.rb +8 -0
  25. data/lib/rainbows/fiber/rev/kato.rb +22 -0
  26. data/lib/rainbows/fiber/rev/methods.rb +55 -0
  27. data/lib/rainbows/fiber/rev/server.rb +32 -0
  28. data/lib/rainbows/fiber/rev/sleeper.rb +15 -0
  29. data/lib/rainbows/fiber/rev.rb +6 -164
  30. data/lib/rainbows/fiber.rb +23 -5
  31. data/lib/rainbows/fiber_pool.rb +31 -37
  32. data/lib/rainbows/fiber_spawn.rb +21 -28
  33. data/lib/rainbows/http_server.rb +80 -80
  34. data/lib/rainbows/max_body.rb +26 -28
  35. data/lib/rainbows/process_client.rb +61 -0
  36. data/lib/rainbows/queue_pool.rb +19 -22
  37. data/lib/rainbows/read_timeout.rb +28 -0
  38. data/lib/rainbows/rev/client.rb +10 -10
  39. data/lib/rainbows/rev/core.rb +2 -3
  40. data/lib/rainbows/rev/thread.rb +1 -1
  41. data/lib/rainbows/rev_fiber_spawn.rb +21 -24
  42. data/lib/rainbows/revactor.rb +18 -15
  43. data/lib/rainbows/thread_pool.rb +2 -4
  44. data/lib/rainbows/thread_spawn.rb +1 -2
  45. data/lib/rainbows/writer_thread_pool.rb +14 -4
  46. data/lib/rainbows/writer_thread_spawn.rb +14 -4
  47. data/lib/rainbows.rb +7 -15
  48. data/local.mk.sample +3 -11
  49. data/rainbows.gemspec +2 -4
  50. data/t/kgio-pipe-response.ru +10 -0
  51. data/t/t0035-kgio-pipe-response.sh +70 -0
  52. data/t/test_isolate.rb +2 -1
  53. metadata +46 -30
  54. data/lib/rainbows/acceptor.rb +0 -26
  55. data/lib/rainbows/byte_slice.rb +0 -17
data/.manifest CHANGED
@@ -25,11 +25,10 @@ TUNING
25
25
  Test_Suite
26
26
  bin/rainbows
27
27
  lib/rainbows.rb
28
- lib/rainbows/acceptor.rb
29
28
  lib/rainbows/actor_spawn.rb
30
29
  lib/rainbows/app_pool.rb
31
30
  lib/rainbows/base.rb
32
- lib/rainbows/byte_slice.rb
31
+ lib/rainbows/client.rb
33
32
  lib/rainbows/configurator.rb
34
33
  lib/rainbows/const.rb
35
34
  lib/rainbows/dev_fd_response.rb
@@ -43,8 +42,17 @@ lib/rainbows/fiber.rb
43
42
  lib/rainbows/fiber/base.rb
44
43
  lib/rainbows/fiber/body.rb
45
44
  lib/rainbows/fiber/io.rb
45
+ lib/rainbows/fiber/io/compat.rb
46
+ lib/rainbows/fiber/io/methods.rb
47
+ lib/rainbows/fiber/io/pipe.rb
48
+ lib/rainbows/fiber/io/socket.rb
46
49
  lib/rainbows/fiber/queue.rb
47
50
  lib/rainbows/fiber/rev.rb
51
+ lib/rainbows/fiber/rev/heartbeat.rb
52
+ lib/rainbows/fiber/rev/kato.rb
53
+ lib/rainbows/fiber/rev/methods.rb
54
+ lib/rainbows/fiber/rev/server.rb
55
+ lib/rainbows/fiber/rev/sleeper.rb
48
56
  lib/rainbows/fiber_pool.rb
49
57
  lib/rainbows/fiber_spawn.rb
50
58
  lib/rainbows/http_response.rb
@@ -52,7 +60,9 @@ lib/rainbows/http_server.rb
52
60
  lib/rainbows/max_body.rb
53
61
  lib/rainbows/never_block.rb
54
62
  lib/rainbows/never_block/event_machine.rb
63
+ lib/rainbows/process_client.rb
55
64
  lib/rainbows/queue_pool.rb
65
+ lib/rainbows/read_timeout.rb
56
66
  lib/rainbows/response.rb
57
67
  lib/rainbows/response/body.rb
58
68
  lib/rainbows/response/range.rb
@@ -110,6 +120,7 @@ t/fast-pipe-response.ru
110
120
  t/file-wrap-to_path.ru
111
121
  t/fork-sleep.ru
112
122
  t/heartbeat-timeout.ru
123
+ t/kgio-pipe-response.ru
113
124
  t/large-file-response.ru
114
125
  t/my-tap-lib.sh
115
126
  t/rack-fiber_pool/app.ru
@@ -162,6 +173,7 @@ t/t0030-fast-pipe-response.sh
162
173
  t/t0031-close-pipe-response.sh
163
174
  t/t0032-close-pipe-to_path-response.sh
164
175
  t/t0034-pipelined-pipe-response.sh
176
+ t/t0035-kgio-pipe-response.sh
165
177
  t/t0100-rack-input-hammer-chunked.sh
166
178
  t/t0100-rack-input-hammer-content-length.sh
167
179
  t/t0101-rack-input-trailer.sh
data/ChangeLog CHANGED
@@ -1,178 +1,147 @@
1
- ChangeLog from git://git.bogomips.org/rainbows.git (v0.96.0..v0.97.0)
1
+ ChangeLog from git://git.bogomips.org/rainbows.git (v0.97.0..v1.0.0pre1)
2
2
 
3
- commit aaa01d6a15847c227c61254f7b8f0ee82275a94d
3
+ commit a47cd4a7f392a76357ed4f3e458797ae1f9c8f25
4
4
  Author: Eric Wong <normalperson@yhbt.net>
5
- Date: Sat Aug 28 19:31:20 2010 +0000
5
+ Date: Tue Oct 26 21:26:03 2010 +0000
6
6
 
7
- Rainbows! 0.97.0
7
+ Rainbows! 1.0.0pre1 - kinder, gentler I/O
8
8
 
9
- We now depend on Unicorn 1.1.3 to avoid race conditions during
10
- log cycling. This bug mainly affected folks using Rainbows! as
11
- a multithreaded static file server.
12
-
13
- "keepalive_timeout 0" now works as documented for all backends
14
- to completely disable keepalive. This was previously broken
15
- under EventMachine, Rev, and Revactor.
16
-
17
- There is a new Rainbows::ThreadTimeout Rack middleware which
18
- gives soft timeouts to apps running on multithreaded backends.
19
-
20
- There are several bugfixes for proxying IO objects and the usual
21
- round of small code cleanups and documentation updates.
22
-
23
- See the commits in git for all the details.
9
+ Mostly internal changes for kgio (and Unicorn) integration.
10
+ There should be no (supported) user-visible changes from
11
+ Rainbows! 0.97.0. kgio should improve performance for
12
+ concurrency models that use non-blocking I/O internally,
13
+ especially under Ruby 1.9.2
24
14
 
25
- commit 4bb365590b4ac2c4ae43a6c6252a98d2d4b7a601
15
+ commit 0298a6743f2cadf8c8e47a298c5b35505b74af46
26
16
  Author: Eric Wong <normalperson@yhbt.net>
27
- Date: Sat Aug 28 19:29:36 2010 +0000
17
+ Date: Tue Oct 26 21:20:45 2010 +0000
28
18
 
29
- bump Unicorn dependency to 1.1.3
19
+ gemspec: bump development dependency of Isolate
30
20
 
31
- Unicorn 1.1.3 fixes potential race conditions during
32
- SIGUSR1 log reopening.
21
+ Might as well go with the latest and greatest,
22
+ it has saner defaults at least.
33
23
 
34
- commit 32d3b1f052810eb15362d001d1501be0e2da88d8
24
+ commit 567e6ce5dba5ad2cca2cca8c64123e27939bff2b
35
25
  Author: Eric Wong <normalperson@yhbt.net>
36
- Date: Sat Aug 28 06:50:51 2010 +0000
26
+ Date: Tue Oct 26 21:13:10 2010 +0000
37
27
 
38
- "keepalive_timeout 0" (really) disables keepalive
39
-
40
- Although this behavior is mentioned on the documentation,
41
- this was broken under EventMachine, Rev*, and Revactor.
28
+ doc: RDoc updates
42
29
 
43
- Furthermore, we set the "Connection: close" header to allow the
44
- client to optimize is handling of non-keepalive connections.
30
+ Once again we avoid documenting internals on the public
31
+ website and use code comments for other developers.
45
32
 
46
- commit 108d6afd7ff390bb594c99ba23c91163fa98d8c0
33
+ commit 894cb73887c106acc793f0317ee849ae215ead56
47
34
  Author: Eric Wong <normalperson@yhbt.net>
48
- Date: Sat Aug 28 06:11:45 2010 +0000
35
+ Date: Mon Oct 25 22:15:47 2010 +0000
49
36
 
50
- t0016: disable Rack::Lint for speed
51
-
52
- Rack::Lint uses String#inspect to generate assertion messages
53
- whether or not the assertions are triggered at all.
54
- Unfortunately String#inspect is hilariously slow under 1.9.2
55
- when dealing with odd characters and large strings.
37
+ reduce dependency on IO#write_nonblock
56
38
 
57
- The performance difference is huge:
58
-
59
- before: 1m4.386s
60
- after: 0m3.877s
39
+ kgio_trywrite is superior if it is available.
40
+
41
+ commit 4ee6e0dafeb1b7af28fa90ae27c1a1a04aa8e852
42
+ Author: Eric Wong <normalperson@yhbt.net>
43
+ Date: Sat Oct 23 00:42:04 2010 +0000
44
+
45
+ http_request: remove this (sub)class
61
46
 
62
- We already have Rack::Lint enabled everywhere else, so removing
63
- this where performance matters most shouldn't hurt us.
47
+ It does not appear to be needed, for now, since the
48
+ parser and Unicorn::HttpRequest are one and the same.
64
49
 
65
- commit 33eeda85248c9132366f94f1e1a83365bb33b5a7
50
+ commit 180485d49ea858f83ef2a28a9e07224aa514edc7
66
51
  Author: Eric Wong <normalperson@yhbt.net>
67
- Date: Sat Aug 28 03:23:51 2010 +0000
52
+ Date: Fri Oct 22 16:21:03 2010 -0700
68
53
 
69
- rev_thread_*: fix IO proxy failures w/pipelining
54
+ unindent most files
70
55
 
71
- Proxying IO objects with threaded Rev concurrency models
72
- occasionally failed with pipelined requests (t0034). By
73
- deferring the on_write_complete callback until the next
74
- "tick" (similar to what we do in Rev::Client#write),
75
- we prevent clobbering responses during pipelining.
56
+ This simplifies and disambiguates most constant resolution
57
+ issues as well as lowering our identation level. Hopefully
58
+ this makes code easier to understand.
76
59
 
77
- commit 6e3a07b69e79ee0d3f554cbe72d37669586fa449
60
+ commit 41145ed4d335718ac43aec9313b7571a12fe96ee
78
61
  Author: Eric Wong <normalperson@yhbt.net>
79
- Date: Fri Aug 27 07:35:23 2010 +0000
62
+ Date: Fri Oct 22 15:31:47 2010 -0700
80
63
 
81
- rainbows/rev/core: tiny cleanup
64
+ local.mk.sample: remove testing under 1.9.1
82
65
 
83
- Remove an unused constant.
66
+ Ruby 1.9.2 has been out for a while and is the stable
67
+ release nowadays.
84
68
 
85
- commit 81ec1240c2e358dcd66b3678e0b771669b1ee68e
69
+ commit b595ad7333ff85452b229674c6726e40d2cf7bb9
86
70
  Author: Eric Wong <normalperson@yhbt.net>
87
- Date: Fri Aug 27 07:17:38 2010 +0000
71
+ Date: Fri Oct 22 18:55:46 2010 +0000
88
72
 
89
- rainbows/rev/master: unindent
73
+ README: update copyright year
90
74
 
91
- No constant resolution changes, avoid redefining
92
- modules needlessly since this is not meant to be
93
- used standalone.
75
+ This project is over 1 year old!
94
76
 
95
- commit 47e1ee2d90161abf92ce14562bf508398fdfa6c9
96
- Author: Eric Wong <e@yhbt.net>
97
- Date: Wed Aug 25 13:58:11 2010 -0700
77
+ commit 4a568eeb7d17885579790d0ae004f04aa13479cb
78
+ Author: Eric Wong <normalperson@yhbt.net>
79
+ Date: Fri Oct 22 02:50:09 2010 +0000
98
80
 
99
- split out accept() callers to acceptor module
81
+ dev_fd_response: do not wrap for Fiber-aware IOs
100
82
 
101
- Trying to avoid adding singleton methods since it's too easily
102
- accessible by the public and not needed by the general public.
103
- This also allows us (or just Zbatery) to more easily add support
104
- systems without FD_CLOEXEC or fcntl, and also to optimize
105
- away a fcntl call for systems that inherit FD_CLOEXEC.
83
+ Applications may use wait_readable-aware methods directly
84
+ to work with Rainbows!
106
85
 
107
- commit bd3ed0b04f826b20cce83f9b77fc13c0eefd3902
86
+ commit 6d46978bdc8d2ee4263431ecdcada53389b12597
108
87
  Author: Eric Wong <normalperson@yhbt.net>
109
- Date: Wed Aug 18 23:59:21 2010 -0700
88
+ Date: Fri Oct 22 02:51:18 2010 +0000
110
89
 
111
- add Rainbows::ThreadTimeout middleware
90
+ fiber_{pool,spawn}: unindent
112
91
 
113
- This allows for per-dispatch timeouts similar to (but not exactly)
114
- the way Mongrel (1.1.x) implemented them with threads.
92
+ Reduces confusion for constant resolution/scoping rules
93
+ and lowers LoC.
115
94
 
116
- commit ac05e7035e1946b78ce4679548db7680aa01734c
95
+ commit 03806d2b44c2d3cee75258ee9e83d671e751baeb
117
96
  Author: Eric Wong <normalperson@yhbt.net>
118
- Date: Tue Aug 17 08:35:03 2010 +0000
97
+ Date: Fri Oct 22 02:38:40 2010 +0000
119
98
 
120
- avoid EBADF with certain middlewares when proxying
99
+ fiber_pool: no need for old Fiber::IO
121
100
 
122
- First off we use an FD_MAP to avoid creating redundant IO
123
- objects which map to the same FD. When that doesn't work, we'll
124
- fall back to trapping Errno::EBADF and IOError where
125
- appropriate.
101
+ Rainbows::Client takes care of the I/O wait/read-ability
102
+ for us already.
126
103
 
127
- commit 9c5669e232f8f57c2d8e08d84e21bf09cd87bfa1
104
+ commit 15631717fce044fbad2f386a7b1c7daf4bdd83d2
128
105
  Author: Eric Wong <normalperson@yhbt.net>
129
- Date: Tue Aug 17 05:30:49 2010 +0000
106
+ Date: Thu Oct 21 16:25:39 2010 -0700
130
107
 
131
- rev/client: fix redundant close of client sockets
108
+ code shuffling for kgio
132
109
 
133
- Our keep-alive timeout mechanism does not need to kick in and
134
- redundantly close when a client. Fortunately there is no danger
135
- of redundantly closing the same numeric file descriptors (and
136
- perhaps causing difficult-to-track-down errors).
110
+ Despite the large number of changes, most of it is code
111
+ movement here.
137
112
 
138
- commit 2f0ac01589cdc9775f7a5668c4ac491712a9f1b1
113
+ commit d4a2b5dd2b85f4b2d3bb120ee1e1b0dde31bc25c
139
114
  Author: Eric Wong <normalperson@yhbt.net>
140
- Date: Mon Aug 16 01:02:30 2010 +0000
115
+ Date: Wed Oct 20 17:48:58 2010 -0700
141
116
 
142
- FAQ: update SSL section, add Pound
117
+ unicorn 2.x updates + kgio
143
118
 
144
- Pound appears to work well in my limited testing with
145
- t/sha1.ru and "curl -T-"
119
+ We get basic internal API changes from Unicorn,
120
+ code simplifications coming next.
146
121
 
147
- commit a8f16c6837b56f1a344e4686d029a9a068f69491
122
+ commit a085ba3586756ac1f778d2862f75889de2449b0e
148
123
  Author: Eric Wong <normalperson@yhbt.net>
149
- Date: Fri Aug 13 13:37:46 2010 -0700
124
+ Date: Wed Oct 20 17:48:57 2010 -0700
150
125
 
151
- dev_fd_response: weaken /dev/fd check for compatibility
126
+ http_server: more descriptive error for debugging
152
127
 
153
- /dev/fd/0 may not be stat()-able on some systems after dropping
154
- permissions from root to a regular user. So just check for
155
- "/dev/fd" which seems to work on RHEL 2.6.18 kernels. This also
156
- allow us to be used independently of Unicorn in case somebody
157
- ever feels the compelling need to /close/ stdin.
128
+ Sometimes we have stupid syntax or constant resolution
129
+ errors in our code.
158
130
 
159
- commit 047365a95fda8765d4339036d41f0cb5f30a1381
131
+ commit ad821f70a2488a91f2be1ac53cb2e64f50743989
160
132
  Author: Eric Wong <normalperson@yhbt.net>
161
- Date: Tue Aug 10 06:39:40 2010 +0000
133
+ Date: Tue Sep 28 17:40:01 2010 -0700
162
134
 
163
- doc: it's always "Rainbows!" with a bang(!)
135
+ start using kgio library
164
136
 
165
- That is the official name of the project and we will not lead
166
- people to believe differently.
137
+ It removes the burden of byte slicing and setting file
138
+ descriptor flags. In some cases, we can remove unnecessary
139
+ peeraddr calls, too.
167
140
 
168
- commit 66e48599b0d98d059862e2eeb64935b0abebc9d0
141
+ commit 11c75ec06ce72cea0c760161dc01a196500aa293
169
142
  Author: Eric Wong <normalperson@yhbt.net>
170
- Date: Mon Aug 9 16:14:38 2010 -0700
143
+ Date: Fri Sep 17 08:55:35 2010 +0000
171
144
 
172
- FAQ: update Rails requires for Ruby 1.9.2
145
+ event_machine: remove unnecessary "return"
173
146
 
174
- Ruby 1.9.2 no longer includes '.' inside $LOAD_PATH by default,
175
- so those requires won't work unless we specify the full path.
176
- We prefer File.expand_path to prefixing './' since we want to be
177
- consistent with what Rails itself uses to prevent
178
- double-requires.
147
+ Noise is bad.
data/GIT-VERSION-FILE CHANGED
@@ -1 +1 @@
1
- GIT_VERSION = 0.97.0
1
+ GIT_VERSION = 1.0.0pre1
data/GIT-VERSION-GEN CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/bin/sh
2
2
 
3
3
  GVF=GIT-VERSION-FILE
4
- DEF_VER=v0.97.0.GIT
4
+ DEF_VER=v1.0.0pre1.GIT
5
5
 
6
6
  LF='
7
7
  '
data/GNUmakefile CHANGED
@@ -62,7 +62,7 @@ NEWS: GIT-VERSION-FILE
62
62
  $(RAKE) -s news_rdoc > $@+
63
63
  mv $@+ $@
64
64
 
65
- SINCE = 0.96.0
65
+ SINCE = 0.97.0
66
66
  ChangeLog: LOG_VERSION = \
67
67
  $(shell git rev-parse -q "$(GIT_VERSION)" >/dev/null 2>&1 && \
68
68
  echo $(GIT_VERSION) || git describe)
data/README CHANGED
@@ -86,7 +86,7 @@ fast applications.
86
86
 
87
87
  == License
88
88
 
89
- \Rainbows! is copyright 2009 by all contributors (see logs in git).
89
+ \Rainbows! is copyright 2009,2010 by all contributors (see logs in git).
90
90
  It is based on Mongrel and Unicorn and carries the same license.
91
91
 
92
92
  Mongrel is copyright 2007 Zed A. Shaw and contributors. It is licensed
data/bin/rainbows CHANGED
@@ -5,16 +5,13 @@ require 'rainbows'
5
5
  require 'optparse'
6
6
 
7
7
  ENV["RACK_ENV"] ||= "development"
8
- daemonize = false
9
- listeners = []
10
- options = { :listeners => listeners }
11
- host, port = Unicorn::Const::DEFAULT_HOST, Unicorn::Const::DEFAULT_PORT
12
- set_listener = false
8
+ rackup_opts = Unicorn::Configurator::RACKUP
9
+ options = rackup_opts[:options]
13
10
 
14
11
  opts = OptionParser.new("", 24, ' ') do |opts|
15
- opts.banner = "Usage: #{File.basename($0)} " \
16
- "[ruby options] [unicorn options] [rackup config file]"
17
-
12
+ cmd = File.basename($0)
13
+ opts.banner = "Usage: #{cmd} " \
14
+ "[ruby options] [#{cmd} options] [rackup config file]"
18
15
  opts.separator "Ruby options:"
19
16
 
20
17
  lineno = 1
@@ -41,20 +38,20 @@ opts = OptionParser.new("", 24, ' ') do |opts|
41
38
  require library
42
39
  end
43
40
 
44
- opts.separator "Rainbows!/Unicorn options:"
41
+ opts.separator "#{cmd} options:"
45
42
 
46
43
  # some of these switches exist for rackup command-line compatibility,
47
44
 
48
45
  opts.on("-o", "--host HOST",
49
46
  "listen on HOST (default: #{Unicorn::Const::DEFAULT_HOST})") do |h|
50
- host = h
51
- set_listener = true
47
+ rackup_opts[:host] = h
48
+ rackup_opts[:set_listener] = true
52
49
  end
53
50
 
54
51
  opts.on("-p", "--port PORT",
55
52
  "use PORT (default: #{Unicorn::Const::DEFAULT_PORT})") do |p|
56
- port = p.to_i
57
- set_listener = true
53
+ rackup_opts[:port] = p.to_i
54
+ rackup_opts[:set_listener] = true
58
55
  end
59
56
 
60
57
  opts.on("-E", "--env RACK_ENV",
@@ -63,7 +60,7 @@ opts = OptionParser.new("", 24, ' ') do |opts|
63
60
  end
64
61
 
65
62
  opts.on("-D", "--daemonize", "run daemonized in the background") do |d|
66
- daemonize = d ? true : false
63
+ rackup_opts[:daemonize] = !!d
67
64
  end
68
65
 
69
66
  opts.on("-P", "--pid FILE", "DEPRECATED") do |f|
@@ -82,11 +79,10 @@ opts = OptionParser.new("", 24, ' ') do |opts|
82
79
  "listen on HOST:PORT or PATH",
83
80
  "this may be specified multiple times",
84
81
  "(default: #{Unicorn::Const::DEFAULT_LISTEN})") do |address|
85
- listeners << address
82
+ options[:listeners] << address
86
83
  end
87
84
 
88
- opts.on("-c", "--config-file FILE",
89
- "Rainbows!/Unicorn-specific config file") do |f|
85
+ opts.on("-c", "--config-file FILE", "Rainbows!-specific config file") do |f|
90
86
  options[:config_file] = f
91
87
  end
92
88
 
@@ -111,16 +107,15 @@ opts = OptionParser.new("", 24, ' ') do |opts|
111
107
  end
112
108
 
113
109
  app = Unicorn.builder(ARGV[0] || 'config.ru', opts)
114
- listeners << "#{host}:#{port}" if set_listener
115
110
 
116
111
  if $DEBUG
117
112
  require 'pp'
118
113
  pp({
119
114
  :unicorn_options => options,
120
115
  :app => app,
121
- :daemonize => daemonize,
116
+ :daemonize => rackup_opts[:daemonize],
122
117
  })
123
118
  end
124
119
 
125
- Unicorn::Launcher.daemonize!(options) if daemonize
120
+ Unicorn::Launcher.daemonize!(options) if rackup_opts[:daemonize]
126
121
  Rainbows.run(app, options)
@@ -1,29 +1,27 @@
1
1
  # -*- encoding: binary -*-
2
2
 
3
3
  require 'actor'
4
- module Rainbows
5
4
 
6
- # Actor concurrency model for Rubinius. We can't seem to get message
7
- # passing working right, so we're throwing a Mutex into the mix for
8
- # now. Hopefully somebody can fix things for us. Currently, this is
9
- # exactly the same as the ThreadSpawn model since we don't use the
10
- # message passing capabilities of the Actor model (and even then
11
- # it wouldn't really make sense since Actors in Rubinius are just
12
- # Threads underneath and our ThreadSpawn model is one layer of
13
- # complexity less.
14
- #
15
- # This is different from the Revactor one which is not prone to race
16
- # conditions within the same process at all (since it uses Fibers).
17
- module ActorSpawn
18
- include ThreadSpawn
5
+ # Actor concurrency model for Rubinius. We can't seem to get message
6
+ # passing working right, so we're throwing a Mutex into the mix for
7
+ # now. Hopefully somebody can fix things for us. Currently, this is
8
+ # exactly the same as the ThreadSpawn model since we don't use the
9
+ # message passing capabilities of the Actor model (and even then
10
+ # it wouldn't really make sense since Actors in Rubinius are just
11
+ # Threads underneath and our ThreadSpawn model is one layer of
12
+ # complexity less.
13
+ #
14
+ # This is different from the Revactor one which is not prone to race
15
+ # conditions within the same process at all (since it uses Fibers).
16
+ module Rainbows::ActorSpawn
17
+ include Rainbows::ThreadSpawn
19
18
 
20
- # runs inside each forked worker, this sits around and waits
21
- # for connections and doesn't die until the parent dies (or is
22
- # given a INT, QUIT, or TERM signal)
23
- def worker_loop(worker) # :nodoc:
24
- Const::RACK_DEFAULTS["rack.multithread"] = true # :(
25
- init_worker_process(worker)
26
- accept_loop(Actor)
27
- end
19
+ # runs inside each forked worker, this sits around and waits
20
+ # for connections and doesn't die until the parent dies (or is
21
+ # given a INT, QUIT, or TERM signal)
22
+ def worker_loop(worker) # :nodoc:
23
+ Rainbows::Const::RACK_DEFAULTS["rack.multithread"] = true # :(
24
+ init_worker_process(worker)
25
+ accept_loop(Actor)
28
26
  end
29
27
  end