rainbows 4.2.0 → 4.3.0
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/.document +32 -1
- data/.wrongdoc.yml +2 -0
- data/GIT-VERSION-GEN +1 -1
- data/TODO +0 -3
- data/lib/rainbows.rb +0 -1
- data/lib/rainbows/const.rb +1 -1
- data/lib/rainbows/coolio/client.rb +2 -1
- data/lib/rainbows/dev_fd_response.rb +1 -1
- data/lib/rainbows/error.rb +2 -4
- data/lib/rainbows/event_machine.rb +2 -2
- data/lib/rainbows/reverse_proxy/coolio.rb +1 -3
- data/rainbows.gemspec +2 -2
- data/t/test_isolate.rb +3 -3
- data/t/test_isolate_cramp.rb +1 -1
- metadata +10 -83
- data/lib/rainbows/http_response.rb +0 -26
data/.document
CHANGED
@@ -1,7 +1,38 @@
|
|
1
1
|
ChangeLog
|
2
2
|
DEPLOY
|
3
3
|
FAQ
|
4
|
-
lib
|
4
|
+
lib/rainbows.rb
|
5
|
+
lib/rainbows/actor_spawn.rb
|
6
|
+
lib/rainbows/app_pool.rb
|
7
|
+
lib/rainbows/base.rb
|
8
|
+
lib/rainbows/configurator.rb
|
9
|
+
lib/rainbows/coolio.rb
|
10
|
+
lib/rainbows/coolio_thread_pool.rb
|
11
|
+
lib/rainbows/coolio_thread_spawn.rb
|
12
|
+
lib/rainbows/dev_fd_response.rb
|
13
|
+
lib/rainbows/epoll.rb
|
14
|
+
lib/rainbows/event_machine.rb
|
15
|
+
lib/rainbows/fiber_pool.rb
|
16
|
+
lib/rainbows/fiber_spawn.rb
|
17
|
+
lib/rainbows/max_body.rb
|
18
|
+
lib/rainbows/never_block.rb
|
19
|
+
lib/rainbows/rev.rb
|
20
|
+
lib/rainbows/rev_fiber_spawn.rb
|
21
|
+
lib/rainbows/rev_thread_pool.rb
|
22
|
+
lib/rainbows/rev_thread_spawn.rb
|
23
|
+
lib/rainbows/revactor.rb
|
24
|
+
lib/rainbows/sendfile.rb
|
25
|
+
lib/rainbows/server_token.rb
|
26
|
+
lib/rainbows/stream_response_epoll.rb
|
27
|
+
lib/rainbows/thread_pool.rb
|
28
|
+
lib/rainbows/thread_spawn.rb
|
29
|
+
lib/rainbows/thread_timeout.rb
|
30
|
+
lib/rainbows/worker_yield.rb
|
31
|
+
lib/rainbows/writer_thread_pool.rb
|
32
|
+
lib/rainbows/writer_thread_spawn.rb
|
33
|
+
lib/rainbows/xepoll.rb
|
34
|
+
lib/rainbows/xepoll_thread_pool.rb
|
35
|
+
lib/rainbows/xepoll_thread_spawn.rb
|
5
36
|
LATEST
|
6
37
|
LICENSE
|
7
38
|
NEWS
|
data/.wrongdoc.yml
CHANGED
data/GIT-VERSION-GEN
CHANGED
data/TODO
CHANGED
@@ -7,9 +7,6 @@ care about.
|
|
7
7
|
|
8
8
|
* documentation improvements
|
9
9
|
|
10
|
-
* allow _OPTIONAL_ splice(2) with DevFdResponse under Linux
|
11
|
-
(splice is very broken under some older kernels)
|
12
|
-
|
13
10
|
* Improve test suite coverage. We won't waste cycles with puny
|
14
11
|
unit tests, only integration tests that exercise externally
|
15
12
|
visible parts.
|
data/lib/rainbows.rb
CHANGED
@@ -121,7 +121,6 @@ module Rainbows
|
|
121
121
|
|
122
122
|
autoload :Fiber, 'rainbows/fiber' # core class
|
123
123
|
autoload :StreamFile, 'rainbows/stream_file'
|
124
|
-
autoload :HttpResponse, 'rainbows/http_response' # deprecated
|
125
124
|
autoload :ThreadTimeout, 'rainbows/thread_timeout'
|
126
125
|
autoload :WorkerYield, 'rainbows/worker_yield'
|
127
126
|
autoload :SyncClose, 'rainbows/sync_close'
|
data/lib/rainbows/const.rb
CHANGED
@@ -164,7 +164,8 @@ class Rainbows::Coolio::Client < Coolio::IO
|
|
164
164
|
begin
|
165
165
|
@deferred.close if @deferred.respond_to?(:close)
|
166
166
|
rescue => e
|
167
|
-
Rainbows.server.logger
|
167
|
+
Unicorn.log_error(Rainbows.server.logger,
|
168
|
+
"closing deferred=#{@deferred.inspect}", e)
|
168
169
|
end
|
169
170
|
@deferred = nil
|
170
171
|
end
|
@@ -69,7 +69,7 @@ class Rainbows::DevFdResponse < Struct.new(:app)
|
|
69
69
|
[ status, headers, Body.new(io, "/dev/fd/#{fileno}", body) ]
|
70
70
|
end
|
71
71
|
|
72
|
-
class Body < Struct.new(:to_io, :to_path, :orig_body)
|
72
|
+
class Body < Struct.new(:to_io, :to_path, :orig_body) # :nodoc:
|
73
73
|
# called by the webserver or other middlewares if they can't
|
74
74
|
# handle #to_path
|
75
75
|
def each
|
data/lib/rainbows/error.rb
CHANGED
@@ -12,15 +12,13 @@ module Rainbows::Error
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def self.app(e)
|
15
|
-
Rainbows.server.logger
|
16
|
-
Rainbows.server.logger.error e.backtrace.join("\n")
|
15
|
+
Unicorn.log_error(Rainbows.server.logger, "app error", e)
|
17
16
|
rescue
|
18
17
|
end
|
19
18
|
|
20
19
|
def self.listen_loop(e)
|
21
20
|
Rainbows.alive or return
|
22
|
-
Rainbows.server.logger
|
23
|
-
Rainbows.server.logger.error e.backtrace.join("\n")
|
21
|
+
Unicorn.log_error(Rainbows.server.logger, "listen loop error", e)
|
24
22
|
rescue
|
25
23
|
end
|
26
24
|
|
@@ -8,7 +8,7 @@ EM::VERSION >= '0.12.10' or abort 'eventmachine 0.12.10 is required'
|
|
8
8
|
# a single-threaded app dispatch. It is suited for slow clients,
|
9
9
|
# and can work with slow applications via asynchronous libraries such as
|
10
10
|
# {async_sinatra}[http://github.com/raggi/async_sinatra],
|
11
|
-
# {Cramp}[http://
|
11
|
+
# {Cramp}[http://cramp.in/],
|
12
12
|
# and {rack-fiber_pool}[http://github.com/mperham/rack-fiber_pool].
|
13
13
|
#
|
14
14
|
# It does not require your Rack application to be thread-safe,
|
@@ -23,7 +23,7 @@ EM::VERSION >= '0.12.10' or abort 'eventmachine 0.12.10 is required'
|
|
23
23
|
# {async_sinatra}[http://github.com/raggi/async_sinatra].
|
24
24
|
#
|
25
25
|
# For a complete asynchronous framework,
|
26
|
-
# {Cramp}[http://
|
26
|
+
# {Cramp}[http://cramp.in/] is fully
|
27
27
|
# supported when using this concurrency model.
|
28
28
|
#
|
29
29
|
# This model is fully-compatible with
|
@@ -43,9 +43,7 @@ module Rainbows::ReverseProxy::Coolio
|
|
43
43
|
return close
|
44
44
|
when SystemCallError
|
45
45
|
else
|
46
|
-
|
47
|
-
logger.error "#{e} #{e.message}"
|
48
|
-
e.backtrace.each { |m| logger.error m }
|
46
|
+
Unicorn.log_error(@env["rack.logger"], "on_readable", e)
|
49
47
|
end
|
50
48
|
@env[AsyncCallback].call(Rainbows::ReverseProxy::E502)
|
51
49
|
close
|
data/rainbows.gemspec
CHANGED
@@ -28,9 +28,9 @@ Gem::Specification.new do |s|
|
|
28
28
|
s.add_dependency(%q<kgio>, ['~> 2.5'])
|
29
29
|
|
30
30
|
# we need Unicorn for the HTTP parser and process management
|
31
|
-
s.add_dependency(%q<unicorn>, ["~> 4.
|
31
|
+
s.add_dependency(%q<unicorn>, ["~> 4.1"])
|
32
32
|
s.add_development_dependency(%q<isolate>, "~> 3.1")
|
33
|
-
s.add_development_dependency(%q<wrongdoc>, "~> 1.
|
33
|
+
s.add_development_dependency(%q<wrongdoc>, "~> 1.6")
|
34
34
|
|
35
35
|
# optional runtime dependencies depending on configuration
|
36
36
|
# see t/test_isolate.rb for the exact versions we've tested with
|
data/t/test_isolate.rb
CHANGED
@@ -16,14 +16,14 @@ $stdout.reopen($stderr)
|
|
16
16
|
lock = File.open(__FILE__, "rb")
|
17
17
|
lock.flock(File::LOCK_EX)
|
18
18
|
Isolate.now!(opts) do
|
19
|
-
gem 'kgio', '2.
|
19
|
+
gem 'kgio', '2.6.0'
|
20
20
|
gem 'kcar', '0.3.0'
|
21
21
|
gem 'raindrops', '0.7.0'
|
22
|
-
gem 'unicorn', '4.
|
22
|
+
gem 'unicorn', '4.1.0'
|
23
23
|
|
24
24
|
if engine == "ruby"
|
25
25
|
gem 'sendfile', '1.1.0'
|
26
|
-
gem 'cool.io', '1.
|
26
|
+
gem 'cool.io', '1.1.0'
|
27
27
|
|
28
28
|
gem 'eventmachine', '0.12.10'
|
29
29
|
gem 'sinatra', '1.2.0'
|
data/t/test_isolate_cramp.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rainbows
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 51
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 4
|
8
|
-
-
|
8
|
+
- 3
|
9
9
|
- 0
|
10
|
-
version: 4.
|
10
|
+
version: 4.3.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Rainbows! hackers
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-08-
|
18
|
+
date: 2011-08-20 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rack
|
@@ -55,11 +55,11 @@ dependencies:
|
|
55
55
|
requirements:
|
56
56
|
- - ~>
|
57
57
|
- !ruby/object:Gem::Version
|
58
|
-
hash:
|
58
|
+
hash: 25
|
59
59
|
segments:
|
60
60
|
- 4
|
61
|
-
-
|
62
|
-
version: "4.
|
61
|
+
- 1
|
62
|
+
version: "4.1"
|
63
63
|
type: :runtime
|
64
64
|
version_requirements: *id003
|
65
65
|
- !ruby/object:Gem::Dependency
|
@@ -85,11 +85,11 @@ dependencies:
|
|
85
85
|
requirements:
|
86
86
|
- - ~>
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
hash:
|
88
|
+
hash: 3
|
89
89
|
segments:
|
90
90
|
- 1
|
91
|
-
-
|
92
|
-
version: "1.
|
91
|
+
- 6
|
92
|
+
version: "1.6"
|
93
93
|
type: :development
|
94
94
|
version_requirements: *id005
|
95
95
|
description: |-
|
@@ -109,106 +109,34 @@ extra_rdoc_files:
|
|
109
109
|
- lib/rainbows/actor_spawn.rb
|
110
110
|
- lib/rainbows/app_pool.rb
|
111
111
|
- lib/rainbows/base.rb
|
112
|
-
- lib/rainbows/client.rb
|
113
112
|
- lib/rainbows/configurator.rb
|
114
|
-
- lib/rainbows/const.rb
|
115
113
|
- lib/rainbows/coolio.rb
|
116
|
-
- lib/rainbows/coolio/client.rb
|
117
|
-
- lib/rainbows/coolio/core.rb
|
118
|
-
- lib/rainbows/coolio/heartbeat.rb
|
119
|
-
- lib/rainbows/coolio/master.rb
|
120
|
-
- lib/rainbows/coolio/response_chunk_pipe.rb
|
121
|
-
- lib/rainbows/coolio/response_pipe.rb
|
122
|
-
- lib/rainbows/coolio/server.rb
|
123
|
-
- lib/rainbows/coolio/thread_client.rb
|
124
|
-
- lib/rainbows/coolio_fiber_spawn.rb
|
125
|
-
- lib/rainbows/coolio_support.rb
|
126
114
|
- lib/rainbows/coolio_thread_pool.rb
|
127
|
-
- lib/rainbows/coolio_thread_pool/client.rb
|
128
|
-
- lib/rainbows/coolio_thread_pool/watcher.rb
|
129
115
|
- lib/rainbows/coolio_thread_spawn.rb
|
130
|
-
- lib/rainbows/coolio_thread_spawn/client.rb
|
131
116
|
- lib/rainbows/dev_fd_response.rb
|
132
117
|
- lib/rainbows/epoll.rb
|
133
|
-
- lib/rainbows/epoll/client.rb
|
134
|
-
- lib/rainbows/epoll/response_chunk_pipe.rb
|
135
|
-
- lib/rainbows/epoll/response_pipe.rb
|
136
|
-
- lib/rainbows/epoll/server.rb
|
137
|
-
- lib/rainbows/error.rb
|
138
|
-
- lib/rainbows/ev_core.rb
|
139
|
-
- lib/rainbows/ev_core/cap_input.rb
|
140
118
|
- lib/rainbows/event_machine.rb
|
141
|
-
- lib/rainbows/event_machine/client.rb
|
142
|
-
- lib/rainbows/event_machine/response_chunk_pipe.rb
|
143
|
-
- lib/rainbows/event_machine/response_pipe.rb
|
144
|
-
- lib/rainbows/event_machine/server.rb
|
145
|
-
- lib/rainbows/event_machine/try_defer.rb
|
146
|
-
- lib/rainbows/fiber.rb
|
147
|
-
- lib/rainbows/fiber/base.rb
|
148
|
-
- lib/rainbows/fiber/body.rb
|
149
|
-
- lib/rainbows/fiber/coolio.rb
|
150
|
-
- lib/rainbows/fiber/coolio/heartbeat.rb
|
151
|
-
- lib/rainbows/fiber/coolio/methods.rb
|
152
|
-
- lib/rainbows/fiber/coolio/server.rb
|
153
|
-
- lib/rainbows/fiber/coolio/sleeper.rb
|
154
|
-
- lib/rainbows/fiber/io.rb
|
155
|
-
- lib/rainbows/fiber/io/compat.rb
|
156
|
-
- lib/rainbows/fiber/io/methods.rb
|
157
|
-
- lib/rainbows/fiber/io/pipe.rb
|
158
|
-
- lib/rainbows/fiber/io/socket.rb
|
159
|
-
- lib/rainbows/fiber/queue.rb
|
160
119
|
- lib/rainbows/fiber_pool.rb
|
161
120
|
- lib/rainbows/fiber_spawn.rb
|
162
|
-
- lib/rainbows/http_parser.rb
|
163
|
-
- lib/rainbows/http_response.rb
|
164
|
-
- lib/rainbows/http_server.rb
|
165
|
-
- lib/rainbows/join_threads.rb
|
166
121
|
- lib/rainbows/max_body.rb
|
167
|
-
- lib/rainbows/max_body/rewindable_wrapper.rb
|
168
|
-
- lib/rainbows/max_body/wrapper.rb
|
169
122
|
- lib/rainbows/never_block.rb
|
170
|
-
- lib/rainbows/never_block/core.rb
|
171
|
-
- lib/rainbows/never_block/event_machine.rb
|
172
|
-
- lib/rainbows/pool_size.rb
|
173
|
-
- lib/rainbows/process_client.rb
|
174
|
-
- lib/rainbows/queue_pool.rb
|
175
|
-
- lib/rainbows/response.rb
|
176
123
|
- lib/rainbows/rev.rb
|
177
124
|
- lib/rainbows/rev_fiber_spawn.rb
|
178
125
|
- lib/rainbows/rev_thread_pool.rb
|
179
126
|
- lib/rainbows/rev_thread_spawn.rb
|
180
127
|
- lib/rainbows/revactor.rb
|
181
|
-
- lib/rainbows/revactor/client.rb
|
182
|
-
- lib/rainbows/revactor/client/methods.rb
|
183
|
-
- lib/rainbows/revactor/client/tee_socket.rb
|
184
|
-
- lib/rainbows/revactor/proxy.rb
|
185
|
-
- lib/rainbows/reverse_proxy.rb
|
186
|
-
- lib/rainbows/reverse_proxy/coolio.rb
|
187
|
-
- lib/rainbows/reverse_proxy/ev_client.rb
|
188
|
-
- lib/rainbows/reverse_proxy/event_machine.rb
|
189
|
-
- lib/rainbows/reverse_proxy/multi_thread.rb
|
190
|
-
- lib/rainbows/reverse_proxy/synchronous.rb
|
191
128
|
- lib/rainbows/sendfile.rb
|
192
129
|
- lib/rainbows/server_token.rb
|
193
|
-
- lib/rainbows/socket_proxy.rb
|
194
|
-
- lib/rainbows/stream_file.rb
|
195
130
|
- lib/rainbows/stream_response_epoll.rb
|
196
|
-
- lib/rainbows/stream_response_epoll/client.rb
|
197
|
-
- lib/rainbows/sync_close.rb
|
198
131
|
- lib/rainbows/thread_pool.rb
|
199
132
|
- lib/rainbows/thread_spawn.rb
|
200
133
|
- lib/rainbows/thread_timeout.rb
|
201
134
|
- lib/rainbows/worker_yield.rb
|
202
135
|
- lib/rainbows/writer_thread_pool.rb
|
203
|
-
- lib/rainbows/writer_thread_pool/client.rb
|
204
136
|
- lib/rainbows/writer_thread_spawn.rb
|
205
|
-
- lib/rainbows/writer_thread_spawn/client.rb
|
206
137
|
- lib/rainbows/xepoll.rb
|
207
|
-
- lib/rainbows/xepoll/client.rb
|
208
138
|
- lib/rainbows/xepoll_thread_pool.rb
|
209
|
-
- lib/rainbows/xepoll_thread_pool/client.rb
|
210
139
|
- lib/rainbows/xepoll_thread_spawn.rb
|
211
|
-
- lib/rainbows/xepoll_thread_spawn/client.rb
|
212
140
|
- LATEST
|
213
141
|
- LICENSE
|
214
142
|
- NEWS
|
@@ -307,7 +235,6 @@ files:
|
|
307
235
|
- lib/rainbows/fiber_pool.rb
|
308
236
|
- lib/rainbows/fiber_spawn.rb
|
309
237
|
- lib/rainbows/http_parser.rb
|
310
|
-
- lib/rainbows/http_response.rb
|
311
238
|
- lib/rainbows/http_server.rb
|
312
239
|
- lib/rainbows/join_threads.rb
|
313
240
|
- lib/rainbows/max_body.rb
|
@@ -1,26 +0,0 @@
|
|
1
|
-
# -*- encoding: binary -*-
|
2
|
-
# :enddoc:
|
3
|
-
# deprecated, use Rainbows::Response instead
|
4
|
-
# Cramp 0.11 relies on this, and is only activated by Cramp
|
5
|
-
if defined?(Cramp) && defined?(Rainbows::EventMachine::Client)
|
6
|
-
class Rainbows::HttpResponse
|
7
|
-
# dummy method for Cramp to alias_method_chain
|
8
|
-
def self.write(client, response, out)
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
module Rainbows::EventMachine::CrampSocket
|
13
|
-
def em_write_response(response, alive = false)
|
14
|
-
if websocket?
|
15
|
-
write web_socket_upgrade_data
|
16
|
-
web_socket_handshake!
|
17
|
-
response[1] = nil # disable response headers
|
18
|
-
end
|
19
|
-
super
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
class Rainbows::EventMachine::Client
|
24
|
-
include Rainbows::EventMachine::CrampSocket
|
25
|
-
end
|
26
|
-
end
|