rainbows 0.97.0 → 1.0.0pre1
Sign up to get free protection for your applications and to get access to all the features.
- data/.manifest +14 -2
- data/ChangeLog +87 -118
- data/GIT-VERSION-FILE +1 -1
- data/GIT-VERSION-GEN +1 -1
- data/GNUmakefile +1 -1
- data/README +1 -1
- data/bin/rainbows +15 -20
- data/lib/rainbows/actor_spawn.rb +20 -22
- data/lib/rainbows/app_pool.rb +89 -93
- data/lib/rainbows/base.rb +4 -61
- data/lib/rainbows/client.rb +9 -0
- data/lib/rainbows/configurator.rb +37 -39
- data/lib/rainbows/const.rb +18 -18
- data/lib/rainbows/dev_fd_response.rb +2 -1
- data/lib/rainbows/error.rb +39 -37
- data/lib/rainbows/ev_core.rb +103 -109
- data/lib/rainbows/event_machine.rb +188 -196
- data/lib/rainbows/fiber/base.rb +69 -88
- data/lib/rainbows/fiber/io/compat.rb +13 -0
- data/lib/rainbows/fiber/io/methods.rb +49 -0
- data/lib/rainbows/fiber/io/pipe.rb +7 -0
- data/lib/rainbows/fiber/io/socket.rb +7 -0
- data/lib/rainbows/fiber/io.rb +125 -84
- data/lib/rainbows/fiber/rev/heartbeat.rb +8 -0
- data/lib/rainbows/fiber/rev/kato.rb +22 -0
- data/lib/rainbows/fiber/rev/methods.rb +55 -0
- data/lib/rainbows/fiber/rev/server.rb +32 -0
- data/lib/rainbows/fiber/rev/sleeper.rb +15 -0
- data/lib/rainbows/fiber/rev.rb +6 -164
- data/lib/rainbows/fiber.rb +23 -5
- data/lib/rainbows/fiber_pool.rb +31 -37
- data/lib/rainbows/fiber_spawn.rb +21 -28
- data/lib/rainbows/http_server.rb +80 -80
- data/lib/rainbows/max_body.rb +26 -28
- data/lib/rainbows/process_client.rb +61 -0
- data/lib/rainbows/queue_pool.rb +19 -22
- data/lib/rainbows/read_timeout.rb +28 -0
- data/lib/rainbows/rev/client.rb +10 -10
- data/lib/rainbows/rev/core.rb +2 -3
- data/lib/rainbows/rev/thread.rb +1 -1
- data/lib/rainbows/rev_fiber_spawn.rb +21 -24
- data/lib/rainbows/revactor.rb +18 -15
- data/lib/rainbows/thread_pool.rb +2 -4
- data/lib/rainbows/thread_spawn.rb +1 -2
- data/lib/rainbows/writer_thread_pool.rb +14 -4
- data/lib/rainbows/writer_thread_spawn.rb +14 -4
- data/lib/rainbows.rb +7 -15
- data/local.mk.sample +3 -11
- data/rainbows.gemspec +2 -4
- data/t/kgio-pipe-response.ru +10 -0
- data/t/t0035-kgio-pipe-response.sh +70 -0
- data/t/test_isolate.rb +2 -1
- metadata +46 -30
- data/lib/rainbows/acceptor.rb +0 -26
- 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/
|
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.
|
1
|
+
ChangeLog from git://git.bogomips.org/rainbows.git (v0.97.0..v1.0.0pre1)
|
2
2
|
|
3
|
-
commit
|
3
|
+
commit a47cd4a7f392a76357ed4f3e458797ae1f9c8f25
|
4
4
|
Author: Eric Wong <normalperson@yhbt.net>
|
5
|
-
Date:
|
5
|
+
Date: Tue Oct 26 21:26:03 2010 +0000
|
6
6
|
|
7
|
-
Rainbows! 0.
|
7
|
+
Rainbows! 1.0.0pre1 - kinder, gentler I/O
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
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
|
15
|
+
commit 0298a6743f2cadf8c8e47a298c5b35505b74af46
|
26
16
|
Author: Eric Wong <normalperson@yhbt.net>
|
27
|
-
Date:
|
17
|
+
Date: Tue Oct 26 21:20:45 2010 +0000
|
28
18
|
|
29
|
-
bump
|
19
|
+
gemspec: bump development dependency of Isolate
|
30
20
|
|
31
|
-
|
32
|
-
|
21
|
+
Might as well go with the latest and greatest,
|
22
|
+
it has saner defaults at least.
|
33
23
|
|
34
|
-
commit
|
24
|
+
commit 567e6ce5dba5ad2cca2cca8c64123e27939bff2b
|
35
25
|
Author: Eric Wong <normalperson@yhbt.net>
|
36
|
-
Date:
|
26
|
+
Date: Tue Oct 26 21:13:10 2010 +0000
|
37
27
|
|
38
|
-
|
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
|
-
|
44
|
-
|
30
|
+
Once again we avoid documenting internals on the public
|
31
|
+
website and use code comments for other developers.
|
45
32
|
|
46
|
-
commit
|
33
|
+
commit 894cb73887c106acc793f0317ee849ae215ead56
|
47
34
|
Author: Eric Wong <normalperson@yhbt.net>
|
48
|
-
Date:
|
35
|
+
Date: Mon Oct 25 22:15:47 2010 +0000
|
49
36
|
|
50
|
-
|
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
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
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
|
-
|
63
|
-
|
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
|
50
|
+
commit 180485d49ea858f83ef2a28a9e07224aa514edc7
|
66
51
|
Author: Eric Wong <normalperson@yhbt.net>
|
67
|
-
Date:
|
52
|
+
Date: Fri Oct 22 16:21:03 2010 -0700
|
68
53
|
|
69
|
-
|
54
|
+
unindent most files
|
70
55
|
|
71
|
-
|
72
|
-
|
73
|
-
|
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
|
60
|
+
commit 41145ed4d335718ac43aec9313b7571a12fe96ee
|
78
61
|
Author: Eric Wong <normalperson@yhbt.net>
|
79
|
-
Date: Fri
|
62
|
+
Date: Fri Oct 22 15:31:47 2010 -0700
|
80
63
|
|
81
|
-
|
64
|
+
local.mk.sample: remove testing under 1.9.1
|
82
65
|
|
83
|
-
|
66
|
+
Ruby 1.9.2 has been out for a while and is the stable
|
67
|
+
release nowadays.
|
84
68
|
|
85
|
-
commit
|
69
|
+
commit b595ad7333ff85452b229674c6726e40d2cf7bb9
|
86
70
|
Author: Eric Wong <normalperson@yhbt.net>
|
87
|
-
Date: Fri
|
71
|
+
Date: Fri Oct 22 18:55:46 2010 +0000
|
88
72
|
|
89
|
-
|
73
|
+
README: update copyright year
|
90
74
|
|
91
|
-
|
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
|
96
|
-
Author: Eric Wong <
|
97
|
-
Date:
|
77
|
+
commit 4a568eeb7d17885579790d0ae004f04aa13479cb
|
78
|
+
Author: Eric Wong <normalperson@yhbt.net>
|
79
|
+
Date: Fri Oct 22 02:50:09 2010 +0000
|
98
80
|
|
99
|
-
|
81
|
+
dev_fd_response: do not wrap for Fiber-aware IOs
|
100
82
|
|
101
|
-
|
102
|
-
|
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
|
86
|
+
commit 6d46978bdc8d2ee4263431ecdcada53389b12597
|
108
87
|
Author: Eric Wong <normalperson@yhbt.net>
|
109
|
-
Date:
|
88
|
+
Date: Fri Oct 22 02:51:18 2010 +0000
|
110
89
|
|
111
|
-
|
90
|
+
fiber_{pool,spawn}: unindent
|
112
91
|
|
113
|
-
|
114
|
-
|
92
|
+
Reduces confusion for constant resolution/scoping rules
|
93
|
+
and lowers LoC.
|
115
94
|
|
116
|
-
commit
|
95
|
+
commit 03806d2b44c2d3cee75258ee9e83d671e751baeb
|
117
96
|
Author: Eric Wong <normalperson@yhbt.net>
|
118
|
-
Date:
|
97
|
+
Date: Fri Oct 22 02:38:40 2010 +0000
|
119
98
|
|
120
|
-
|
99
|
+
fiber_pool: no need for old Fiber::IO
|
121
100
|
|
122
|
-
|
123
|
-
|
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
|
104
|
+
commit 15631717fce044fbad2f386a7b1c7daf4bdd83d2
|
128
105
|
Author: Eric Wong <normalperson@yhbt.net>
|
129
|
-
Date:
|
106
|
+
Date: Thu Oct 21 16:25:39 2010 -0700
|
130
107
|
|
131
|
-
|
108
|
+
code shuffling for kgio
|
132
109
|
|
133
|
-
|
134
|
-
|
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
|
113
|
+
commit d4a2b5dd2b85f4b2d3bb120ee1e1b0dde31bc25c
|
139
114
|
Author: Eric Wong <normalperson@yhbt.net>
|
140
|
-
Date:
|
115
|
+
Date: Wed Oct 20 17:48:58 2010 -0700
|
141
116
|
|
142
|
-
|
117
|
+
unicorn 2.x updates + kgio
|
143
118
|
|
144
|
-
|
145
|
-
|
119
|
+
We get basic internal API changes from Unicorn,
|
120
|
+
code simplifications coming next.
|
146
121
|
|
147
|
-
commit
|
122
|
+
commit a085ba3586756ac1f778d2862f75889de2449b0e
|
148
123
|
Author: Eric Wong <normalperson@yhbt.net>
|
149
|
-
Date:
|
124
|
+
Date: Wed Oct 20 17:48:57 2010 -0700
|
150
125
|
|
151
|
-
|
126
|
+
http_server: more descriptive error for debugging
|
152
127
|
|
153
|
-
|
154
|
-
|
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
|
131
|
+
commit ad821f70a2488a91f2be1ac53cb2e64f50743989
|
160
132
|
Author: Eric Wong <normalperson@yhbt.net>
|
161
|
-
Date: Tue
|
133
|
+
Date: Tue Sep 28 17:40:01 2010 -0700
|
162
134
|
|
163
|
-
|
135
|
+
start using kgio library
|
164
136
|
|
165
|
-
|
166
|
-
|
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
|
141
|
+
commit 11c75ec06ce72cea0c760161dc01a196500aa293
|
169
142
|
Author: Eric Wong <normalperson@yhbt.net>
|
170
|
-
Date:
|
143
|
+
Date: Fri Sep 17 08:55:35 2010 +0000
|
171
144
|
|
172
|
-
|
145
|
+
event_machine: remove unnecessary "return"
|
173
146
|
|
174
|
-
|
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.
|
1
|
+
GIT_VERSION = 1.0.0pre1
|
data/GIT-VERSION-GEN
CHANGED
data/GNUmakefile
CHANGED
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
|
-
|
9
|
-
|
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
|
-
|
16
|
-
|
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 "
|
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
|
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)
|
data/lib/rainbows/actor_spawn.rb
CHANGED
@@ -1,29 +1,27 @@
|
|
1
1
|
# -*- encoding: binary -*-
|
2
2
|
|
3
3
|
require 'actor'
|
4
|
-
module Rainbows
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
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
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
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
|