rainbows 2.0.1 → 2.1.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.
Files changed (118) hide show
  1. data/.document +1 -0
  2. data/.gitignore +1 -0
  3. data/.manifest +46 -18
  4. data/.wrongdoc.yml +8 -0
  5. data/ChangeLog +849 -374
  6. data/Documentation/comparison.haml +26 -21
  7. data/FAQ +6 -0
  8. data/GIT-VERSION-GEN +1 -1
  9. data/GNUmakefile +23 -65
  10. data/LATEST +27 -0
  11. data/NEWS +53 -26
  12. data/README +7 -7
  13. data/Rakefile +1 -98
  14. data/Summary +0 -7
  15. data/TODO +2 -2
  16. data/lib/rainbows/app_pool.rb +2 -1
  17. data/lib/rainbows/base.rb +1 -0
  18. data/lib/rainbows/configurator.rb +9 -0
  19. data/lib/rainbows/const.rb +1 -1
  20. data/lib/rainbows/coolio/client.rb +191 -0
  21. data/lib/rainbows/coolio/core.rb +25 -0
  22. data/lib/rainbows/{rev → coolio}/deferred_chunk_response.rb +3 -2
  23. data/lib/rainbows/{rev → coolio}/deferred_response.rb +3 -3
  24. data/lib/rainbows/coolio/heartbeat.rb +20 -0
  25. data/lib/rainbows/{rev → coolio}/master.rb +2 -3
  26. data/lib/rainbows/{rev → coolio}/sendfile.rb +1 -1
  27. data/lib/rainbows/coolio/server.rb +11 -0
  28. data/lib/rainbows/coolio/thread_client.rb +36 -0
  29. data/lib/rainbows/coolio.rb +45 -0
  30. data/lib/rainbows/coolio_fiber_spawn.rb +26 -0
  31. data/lib/rainbows/coolio_support.rb +9 -0
  32. data/lib/rainbows/coolio_thread_pool/client.rb +8 -0
  33. data/lib/rainbows/coolio_thread_pool/watcher.rb +14 -0
  34. data/lib/rainbows/coolio_thread_pool.rb +57 -0
  35. data/lib/rainbows/coolio_thread_spawn/client.rb +8 -0
  36. data/lib/rainbows/coolio_thread_spawn.rb +27 -0
  37. data/lib/rainbows/dev_fd_response.rb +6 -2
  38. data/lib/rainbows/ev_core/cap_input.rb +3 -2
  39. data/lib/rainbows/ev_core.rb +13 -3
  40. data/lib/rainbows/event_machine/client.rb +124 -0
  41. data/lib/rainbows/event_machine/response_pipe.rb +1 -2
  42. data/lib/rainbows/event_machine/server.rb +15 -0
  43. data/lib/rainbows/event_machine.rb +13 -137
  44. data/lib/rainbows/fiber/base.rb +6 -7
  45. data/lib/rainbows/fiber/body.rb +4 -2
  46. data/lib/rainbows/fiber/coolio/heartbeat.rb +15 -0
  47. data/lib/rainbows/fiber/{rev → coolio}/methods.rb +4 -5
  48. data/lib/rainbows/fiber/{rev → coolio}/server.rb +1 -1
  49. data/lib/rainbows/fiber/{rev → coolio}/sleeper.rb +2 -2
  50. data/lib/rainbows/fiber/coolio.rb +12 -0
  51. data/lib/rainbows/fiber/io/methods.rb +6 -0
  52. data/lib/rainbows/fiber/io.rb +8 -10
  53. data/lib/rainbows/fiber/queue.rb +24 -30
  54. data/lib/rainbows/fiber.rb +7 -4
  55. data/lib/rainbows/fiber_pool.rb +1 -1
  56. data/lib/rainbows/http_server.rb +9 -2
  57. data/lib/rainbows/max_body.rb +3 -1
  58. data/lib/rainbows/never_block/core.rb +15 -0
  59. data/lib/rainbows/never_block/event_machine.rb +8 -3
  60. data/lib/rainbows/never_block.rb +37 -70
  61. data/lib/rainbows/process_client.rb +3 -6
  62. data/lib/rainbows/rack_input.rb +17 -0
  63. data/lib/rainbows/response/body.rb +18 -19
  64. data/lib/rainbows/response.rb +1 -1
  65. data/lib/rainbows/rev.rb +21 -43
  66. data/lib/rainbows/rev_fiber_spawn.rb +4 -19
  67. data/lib/rainbows/rev_thread_pool.rb +21 -75
  68. data/lib/rainbows/rev_thread_spawn.rb +18 -36
  69. data/lib/rainbows/revactor/body.rb +4 -1
  70. data/lib/rainbows/revactor/tee_socket.rb +44 -0
  71. data/lib/rainbows/revactor.rb +13 -48
  72. data/lib/rainbows/socket_proxy.rb +24 -0
  73. data/lib/rainbows/sync_close.rb +37 -0
  74. data/lib/rainbows/thread_pool.rb +66 -70
  75. data/lib/rainbows/thread_spawn.rb +40 -50
  76. data/lib/rainbows/thread_timeout.rb +33 -27
  77. data/lib/rainbows/timed_read.rb +5 -1
  78. data/lib/rainbows/worker_yield.rb +16 -0
  79. data/lib/rainbows/writer_thread_pool/client.rb +19 -0
  80. data/lib/rainbows/writer_thread_pool.rb +60 -91
  81. data/lib/rainbows/writer_thread_spawn/client.rb +69 -0
  82. data/lib/rainbows/writer_thread_spawn.rb +37 -117
  83. data/lib/rainbows.rb +12 -4
  84. data/rainbows.gemspec +15 -19
  85. data/t/GNUmakefile +4 -4
  86. data/t/close-has-env.ru +65 -0
  87. data/t/simple-http_Coolio.ru +9 -0
  88. data/t/simple-http_CoolioFiberSpawn.ru +10 -0
  89. data/t/simple-http_CoolioThreadPool.ru +9 -0
  90. data/t/simple-http_CoolioThreadSpawn.ru +9 -0
  91. data/t/t0004-heartbeat-timeout.sh +2 -2
  92. data/t/t0007-worker-follows-master-to-death.sh +1 -1
  93. data/t/t0015-working_directory.sh +7 -1
  94. data/t/t0017-keepalive-timeout-zero.sh +1 -1
  95. data/t/t0019-keepalive-cpu-usage.sh +62 -0
  96. data/t/t0040-keepalive_requests-setting.sh +51 -0
  97. data/t/t0050-response-body-close-has-env.sh +109 -0
  98. data/t/t0102-rack-input-short.sh +6 -6
  99. data/t/t0106-rack-input-keepalive.sh +48 -2
  100. data/t/t0113-rewindable-input-false.sh +28 -0
  101. data/t/t0113.ru +12 -0
  102. data/t/t0114-rewindable-input-true.sh +28 -0
  103. data/t/t0114.ru +12 -0
  104. data/t/t9100-thread-timeout.sh +24 -2
  105. data/t/t9101-thread-timeout-threshold.sh +6 -13
  106. data/t/test-lib.sh +2 -1
  107. data/t/test_isolate.rb +9 -4
  108. data/t/times.ru +6 -0
  109. metadata +109 -42
  110. data/GIT-VERSION-FILE +0 -1
  111. data/lib/rainbows/fiber/rev/heartbeat.rb +0 -8
  112. data/lib/rainbows/fiber/rev/kato.rb +0 -22
  113. data/lib/rainbows/fiber/rev.rb +0 -13
  114. data/lib/rainbows/rev/client.rb +0 -194
  115. data/lib/rainbows/rev/core.rb +0 -41
  116. data/lib/rainbows/rev/heartbeat.rb +0 -23
  117. data/lib/rainbows/rev/thread.rb +0 -46
  118. data/man/man1/rainbows.1 +0 -193
data/t/test_isolate.rb CHANGED
@@ -15,15 +15,15 @@ $stdout.reopen($stderr)
15
15
 
16
16
  Isolate.now!(opts) do
17
17
  gem 'rack', '1.1.0' # Cramp currently requires ~> 1.1.0
18
- gem 'kgio', '2.0.0'
19
- gem 'unicorn', '3.0.1'
18
+ gem 'kgio', '2.1.1'
19
+ gem 'unicorn', '3.2.1'
20
20
  gem 'kcar', '0.1.1'
21
21
 
22
22
  if engine == "ruby"
23
23
  gem 'sendfile', '1.0.0' # next Rubinius should support this
24
24
 
25
25
  gem 'iobuffer', '0.1.3'
26
- gem 'rev', '0.3.2'
26
+ gem 'cool.io', '1.0.0'
27
27
 
28
28
  gem 'eventmachine', '0.12.10'
29
29
  gem 'sinatra', '1.0.0'
@@ -41,4 +41,9 @@ Isolate.now!(opts) do
41
41
  end
42
42
 
43
43
  $stdout.reopen(old_out)
44
- puts Dir["#{path}/gems/*-*/lib"].map { |x| File.expand_path(x) }.join(':')
44
+
45
+ # don't load the old Rev if it exists, Cool.io 1.0.0 is compatible with it,
46
+ # even for everything Revactor uses.
47
+ dirs = Dir["#{path}/gems/*-*/lib"]
48
+ dirs.delete_if { |x| x =~ %r{/rev-[\d\.]+/lib} }
49
+ puts dirs.map { |x| File.expand_path(x) }.join(':')
data/t/times.ru ADDED
@@ -0,0 +1,6 @@
1
+ use Rack::ContentLength
2
+ use Rack::ContentType, "text/plain"
3
+ run lambda { |env|
4
+ t = Process.times
5
+ [ 200, {}, [ "utime=#{t.utime} stime=#{t.stime}" ] ]
6
+ }
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: 13
4
+ hash: 11
5
5
  prerelease: false
6
6
  segments:
7
7
  - 2
8
- - 0
9
8
  - 1
10
- version: 2.0.1
9
+ - 0
10
+ version: 2.1.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: 2010-12-03 00:00:00 +00:00
18
+ date: 2010-12-29 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -41,12 +41,11 @@ dependencies:
41
41
  requirements:
42
42
  - - ~>
43
43
  - !ruby/object:Gem::Version
44
- hash: 7
44
+ hash: 3
45
45
  segments:
46
46
  - 3
47
- - 0
48
- - 0
49
- version: 3.0.0
47
+ - 2
48
+ version: "3.2"
50
49
  type: :runtime
51
50
  version_requirements: *id002
52
51
  - !ruby/object:Gem::Dependency
@@ -65,6 +64,22 @@ dependencies:
65
64
  version: 3.0.0
66
65
  type: :development
67
66
  version_requirements: *id003
67
+ - !ruby/object:Gem::Dependency
68
+ name: wrongdoc
69
+ prerelease: false
70
+ requirement: &id004 !ruby/object:Gem::Requirement
71
+ none: false
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ hash: 21
76
+ segments:
77
+ - 1
78
+ - 0
79
+ - 1
80
+ version: 1.0.1
81
+ type: :development
82
+ version_requirements: *id004
68
83
  description: |-
69
84
  \Rainbows! is an HTTP server for sleepy Rack applications. It is based on
70
85
  Unicorn, but designed to handle applications that expect long
@@ -85,29 +100,47 @@ extra_rdoc_files:
85
100
  - lib/rainbows/client.rb
86
101
  - lib/rainbows/configurator.rb
87
102
  - lib/rainbows/const.rb
103
+ - lib/rainbows/coolio.rb
104
+ - lib/rainbows/coolio/client.rb
105
+ - lib/rainbows/coolio/core.rb
106
+ - lib/rainbows/coolio/deferred_chunk_response.rb
107
+ - lib/rainbows/coolio/deferred_response.rb
108
+ - lib/rainbows/coolio/heartbeat.rb
109
+ - lib/rainbows/coolio/master.rb
110
+ - lib/rainbows/coolio/sendfile.rb
111
+ - lib/rainbows/coolio/server.rb
112
+ - lib/rainbows/coolio/thread_client.rb
113
+ - lib/rainbows/coolio_fiber_spawn.rb
114
+ - lib/rainbows/coolio_support.rb
115
+ - lib/rainbows/coolio_thread_pool.rb
116
+ - lib/rainbows/coolio_thread_pool/client.rb
117
+ - lib/rainbows/coolio_thread_pool/watcher.rb
118
+ - lib/rainbows/coolio_thread_spawn.rb
119
+ - lib/rainbows/coolio_thread_spawn/client.rb
88
120
  - lib/rainbows/dev_fd_response.rb
89
121
  - lib/rainbows/error.rb
90
122
  - lib/rainbows/ev_core.rb
91
123
  - lib/rainbows/ev_core/cap_input.rb
92
124
  - lib/rainbows/event_machine.rb
125
+ - lib/rainbows/event_machine/client.rb
93
126
  - lib/rainbows/event_machine/response_chunk_pipe.rb
94
127
  - lib/rainbows/event_machine/response_pipe.rb
128
+ - lib/rainbows/event_machine/server.rb
95
129
  - lib/rainbows/event_machine/try_defer.rb
96
130
  - lib/rainbows/fiber.rb
97
131
  - lib/rainbows/fiber/base.rb
98
132
  - lib/rainbows/fiber/body.rb
133
+ - lib/rainbows/fiber/coolio.rb
134
+ - lib/rainbows/fiber/coolio/heartbeat.rb
135
+ - lib/rainbows/fiber/coolio/methods.rb
136
+ - lib/rainbows/fiber/coolio/server.rb
137
+ - lib/rainbows/fiber/coolio/sleeper.rb
99
138
  - lib/rainbows/fiber/io.rb
100
139
  - lib/rainbows/fiber/io/compat.rb
101
140
  - lib/rainbows/fiber/io/methods.rb
102
141
  - lib/rainbows/fiber/io/pipe.rb
103
142
  - lib/rainbows/fiber/io/socket.rb
104
143
  - lib/rainbows/fiber/queue.rb
105
- - lib/rainbows/fiber/rev.rb
106
- - lib/rainbows/fiber/rev/heartbeat.rb
107
- - lib/rainbows/fiber/rev/kato.rb
108
- - lib/rainbows/fiber/rev/methods.rb
109
- - lib/rainbows/fiber/rev/server.rb
110
- - lib/rainbows/fiber/rev/sleeper.rb
111
144
  - lib/rainbows/fiber_pool.rb
112
145
  - lib/rainbows/fiber_spawn.rb
113
146
  - lib/rainbows/http_response.rb
@@ -116,36 +149,37 @@ extra_rdoc_files:
116
149
  - lib/rainbows/max_body/rewindable_wrapper.rb
117
150
  - lib/rainbows/max_body/wrapper.rb
118
151
  - lib/rainbows/never_block.rb
152
+ - lib/rainbows/never_block/core.rb
119
153
  - lib/rainbows/never_block/event_machine.rb
120
154
  - lib/rainbows/process_client.rb
121
155
  - lib/rainbows/queue_pool.rb
156
+ - lib/rainbows/rack_input.rb
122
157
  - lib/rainbows/response.rb
123
158
  - lib/rainbows/response/body.rb
124
159
  - lib/rainbows/response/range.rb
125
160
  - lib/rainbows/rev.rb
126
- - lib/rainbows/rev/client.rb
127
- - lib/rainbows/rev/core.rb
128
- - lib/rainbows/rev/deferred_chunk_response.rb
129
- - lib/rainbows/rev/deferred_response.rb
130
- - lib/rainbows/rev/heartbeat.rb
131
- - lib/rainbows/rev/master.rb
132
- - lib/rainbows/rev/sendfile.rb
133
- - lib/rainbows/rev/thread.rb
134
161
  - lib/rainbows/rev_fiber_spawn.rb
135
162
  - lib/rainbows/rev_thread_pool.rb
136
163
  - lib/rainbows/rev_thread_spawn.rb
137
164
  - lib/rainbows/revactor.rb
138
165
  - lib/rainbows/revactor/body.rb
139
166
  - lib/rainbows/revactor/proxy.rb
167
+ - lib/rainbows/revactor/tee_socket.rb
140
168
  - lib/rainbows/sendfile.rb
141
169
  - lib/rainbows/server_token.rb
170
+ - lib/rainbows/socket_proxy.rb
142
171
  - lib/rainbows/stream_file.rb
172
+ - lib/rainbows/sync_close.rb
143
173
  - lib/rainbows/thread_pool.rb
144
174
  - lib/rainbows/thread_spawn.rb
145
175
  - lib/rainbows/thread_timeout.rb
146
176
  - lib/rainbows/timed_read.rb
177
+ - lib/rainbows/worker_yield.rb
147
178
  - lib/rainbows/writer_thread_pool.rb
179
+ - lib/rainbows/writer_thread_pool/client.rb
148
180
  - lib/rainbows/writer_thread_spawn.rb
181
+ - lib/rainbows/writer_thread_spawn/client.rb
182
+ - LATEST
149
183
  - LICENSE
150
184
  - NEWS
151
185
  - README
@@ -160,8 +194,8 @@ files:
160
194
  - .document
161
195
  - .gitignore
162
196
  - .manifest
197
+ - .wrongdoc.yml
163
198
  - COPYING
164
- - ChangeLog
165
199
  - DEPLOY
166
200
  - Documentation/.gitignore
167
201
  - Documentation/GNUmakefile
@@ -169,11 +203,9 @@ files:
169
203
  - Documentation/comparison.haml
170
204
  - Documentation/rainbows.1.txt
171
205
  - FAQ
172
- - GIT-VERSION-FILE
173
206
  - GIT-VERSION-GEN
174
207
  - GNUmakefile
175
208
  - LICENSE
176
- - NEWS
177
209
  - README
178
210
  - Rakefile
179
211
  - SIGNALS
@@ -190,29 +222,47 @@ files:
190
222
  - lib/rainbows/client.rb
191
223
  - lib/rainbows/configurator.rb
192
224
  - lib/rainbows/const.rb
225
+ - lib/rainbows/coolio.rb
226
+ - lib/rainbows/coolio/client.rb
227
+ - lib/rainbows/coolio/core.rb
228
+ - lib/rainbows/coolio/deferred_chunk_response.rb
229
+ - lib/rainbows/coolio/deferred_response.rb
230
+ - lib/rainbows/coolio/heartbeat.rb
231
+ - lib/rainbows/coolio/master.rb
232
+ - lib/rainbows/coolio/sendfile.rb
233
+ - lib/rainbows/coolio/server.rb
234
+ - lib/rainbows/coolio/thread_client.rb
235
+ - lib/rainbows/coolio_fiber_spawn.rb
236
+ - lib/rainbows/coolio_support.rb
237
+ - lib/rainbows/coolio_thread_pool.rb
238
+ - lib/rainbows/coolio_thread_pool/client.rb
239
+ - lib/rainbows/coolio_thread_pool/watcher.rb
240
+ - lib/rainbows/coolio_thread_spawn.rb
241
+ - lib/rainbows/coolio_thread_spawn/client.rb
193
242
  - lib/rainbows/dev_fd_response.rb
194
243
  - lib/rainbows/error.rb
195
244
  - lib/rainbows/ev_core.rb
196
245
  - lib/rainbows/ev_core/cap_input.rb
197
246
  - lib/rainbows/event_machine.rb
247
+ - lib/rainbows/event_machine/client.rb
198
248
  - lib/rainbows/event_machine/response_chunk_pipe.rb
199
249
  - lib/rainbows/event_machine/response_pipe.rb
250
+ - lib/rainbows/event_machine/server.rb
200
251
  - lib/rainbows/event_machine/try_defer.rb
201
252
  - lib/rainbows/fiber.rb
202
253
  - lib/rainbows/fiber/base.rb
203
254
  - lib/rainbows/fiber/body.rb
255
+ - lib/rainbows/fiber/coolio.rb
256
+ - lib/rainbows/fiber/coolio/heartbeat.rb
257
+ - lib/rainbows/fiber/coolio/methods.rb
258
+ - lib/rainbows/fiber/coolio/server.rb
259
+ - lib/rainbows/fiber/coolio/sleeper.rb
204
260
  - lib/rainbows/fiber/io.rb
205
261
  - lib/rainbows/fiber/io/compat.rb
206
262
  - lib/rainbows/fiber/io/methods.rb
207
263
  - lib/rainbows/fiber/io/pipe.rb
208
264
  - lib/rainbows/fiber/io/socket.rb
209
265
  - lib/rainbows/fiber/queue.rb
210
- - lib/rainbows/fiber/rev.rb
211
- - lib/rainbows/fiber/rev/heartbeat.rb
212
- - lib/rainbows/fiber/rev/kato.rb
213
- - lib/rainbows/fiber/rev/methods.rb
214
- - lib/rainbows/fiber/rev/server.rb
215
- - lib/rainbows/fiber/rev/sleeper.rb
216
266
  - lib/rainbows/fiber_pool.rb
217
267
  - lib/rainbows/fiber_spawn.rb
218
268
  - lib/rainbows/http_response.rb
@@ -221,38 +271,37 @@ files:
221
271
  - lib/rainbows/max_body/rewindable_wrapper.rb
222
272
  - lib/rainbows/max_body/wrapper.rb
223
273
  - lib/rainbows/never_block.rb
274
+ - lib/rainbows/never_block/core.rb
224
275
  - lib/rainbows/never_block/event_machine.rb
225
276
  - lib/rainbows/process_client.rb
226
277
  - lib/rainbows/queue_pool.rb
278
+ - lib/rainbows/rack_input.rb
227
279
  - lib/rainbows/response.rb
228
280
  - lib/rainbows/response/body.rb
229
281
  - lib/rainbows/response/range.rb
230
282
  - lib/rainbows/rev.rb
231
- - lib/rainbows/rev/client.rb
232
- - lib/rainbows/rev/core.rb
233
- - lib/rainbows/rev/deferred_chunk_response.rb
234
- - lib/rainbows/rev/deferred_response.rb
235
- - lib/rainbows/rev/heartbeat.rb
236
- - lib/rainbows/rev/master.rb
237
- - lib/rainbows/rev/sendfile.rb
238
- - lib/rainbows/rev/thread.rb
239
283
  - lib/rainbows/rev_fiber_spawn.rb
240
284
  - lib/rainbows/rev_thread_pool.rb
241
285
  - lib/rainbows/rev_thread_spawn.rb
242
286
  - lib/rainbows/revactor.rb
243
287
  - lib/rainbows/revactor/body.rb
244
288
  - lib/rainbows/revactor/proxy.rb
289
+ - lib/rainbows/revactor/tee_socket.rb
245
290
  - lib/rainbows/sendfile.rb
246
291
  - lib/rainbows/server_token.rb
292
+ - lib/rainbows/socket_proxy.rb
247
293
  - lib/rainbows/stream_file.rb
294
+ - lib/rainbows/sync_close.rb
248
295
  - lib/rainbows/thread_pool.rb
249
296
  - lib/rainbows/thread_spawn.rb
250
297
  - lib/rainbows/thread_timeout.rb
251
298
  - lib/rainbows/timed_read.rb
299
+ - lib/rainbows/worker_yield.rb
252
300
  - lib/rainbows/writer_thread_pool.rb
301
+ - lib/rainbows/writer_thread_pool/client.rb
253
302
  - lib/rainbows/writer_thread_spawn.rb
303
+ - lib/rainbows/writer_thread_spawn/client.rb
254
304
  - local.mk.sample
255
- - man/man1/rainbows.1
256
305
  - rainbows.gemspec
257
306
  - setup.rb
258
307
  - t/.gitignore
@@ -269,6 +318,7 @@ files:
269
318
  - t/bin/sha1sum.rb
270
319
  - t/bin/unused_listen
271
320
  - t/bin/utee
321
+ - t/close-has-env.ru
272
322
  - t/close-pipe-response.ru
273
323
  - t/close-pipe-to_path-response.ru
274
324
  - t/content-md5.ru
@@ -289,6 +339,10 @@ files:
289
339
  - t/sha1.ru
290
340
  - t/simple-http_ActorSpawn.ru
291
341
  - t/simple-http_Base.ru
342
+ - t/simple-http_Coolio.ru
343
+ - t/simple-http_CoolioFiberSpawn.ru
344
+ - t/simple-http_CoolioThreadPool.ru
345
+ - t/simple-http_CoolioThreadSpawn.ru
292
346
  - t/simple-http_EventMachine.ru
293
347
  - t/simple-http_FiberPool.ru
294
348
  - t/simple-http_FiberSpawn.ru
@@ -326,6 +380,7 @@ files:
326
380
  - t/t0016.rb
327
381
  - t/t0017-keepalive-timeout-zero.sh
328
382
  - t/t0018-reload-restore-settings.sh
383
+ - t/t0019-keepalive-cpu-usage.sh
329
384
  - t/t0020-large-sendfile-response.sh
330
385
  - t/t0021-sendfile-wrap-to_path.sh
331
386
  - t/t0022-copy_stream-byte-range.sh
@@ -336,6 +391,8 @@ files:
336
391
  - t/t0032-close-pipe-to_path-response.sh
337
392
  - t/t0034-pipelined-pipe-response.sh
338
393
  - t/t0035-kgio-pipe-response.sh
394
+ - t/t0040-keepalive_requests-setting.sh
395
+ - t/t0050-response-body-close-has-env.sh
339
396
  - t/t0100-rack-input-hammer-chunked.sh
340
397
  - t/t0100-rack-input-hammer-content-length.sh
341
398
  - t/t0101-rack-input-trailer.sh
@@ -344,6 +401,10 @@ files:
344
401
  - t/t0104-rack-input-limit-tiny.sh
345
402
  - t/t0105-rack-input-limit-bigger.sh
346
403
  - t/t0106-rack-input-keepalive.sh
404
+ - t/t0113-rewindable-input-false.sh
405
+ - t/t0113.ru
406
+ - t/t0114-rewindable-input-true.sh
407
+ - t/t0114.ru
347
408
  - t/t0200-async-response.sh
348
409
  - t/t0201-async-response-no-autochunk.sh
349
410
  - t/t0300-async_sinatra.sh
@@ -365,8 +426,12 @@ files:
365
426
  - t/t9101.ru
366
427
  - t/test-lib.sh
367
428
  - t/test_isolate.rb
429
+ - t/times.ru
368
430
  - t/worker-follows-master-to-death.ru
369
431
  - vs_Unicorn
432
+ - ChangeLog
433
+ - LATEST
434
+ - NEWS
370
435
  has_rdoc: true
371
436
  homepage: http://rainbows.rubyforge.org/
372
437
  licenses: []
@@ -374,7 +439,9 @@ licenses: []
374
439
  post_install_message:
375
440
  rdoc_options:
376
441
  - -t
377
- - Rainbows! Unicorn for sleepy apps and slow clients
442
+ - Rainbows! - Unicorn for sleepy apps and slow clients
443
+ - -W
444
+ - http://git.bogomips.org/cgit/rainbows.git/tree/%s
378
445
  require_paths:
379
446
  - lib
380
447
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -401,6 +468,6 @@ rubyforge_project: rainbows
401
468
  rubygems_version: 1.3.7
402
469
  signing_key:
403
470
  specification_version: 3
404
- summary: Unicorn for sleepy apps and slow clients
471
+ summary: "- Unicorn for sleepy apps and slow clients"
405
472
  test_files: []
406
473
 
data/GIT-VERSION-FILE DELETED
@@ -1 +0,0 @@
1
- GIT_VERSION = 2.0.1
@@ -1,8 +0,0 @@
1
- # -*- encoding: binary -*-
2
- # :enddoc:
3
- class Rainbows::Fiber::Rev::Heartbeat < Rev::TimerWatcher
4
- G = Rainbows::G
5
- def on_timer
6
- exit if (! G.tick && G.cur <= 0)
7
- end
8
- end
@@ -1,22 +0,0 @@
1
- # -*- encoding: binary -*-
2
- # :enddoc:
3
- # keep-alive timeout class
4
- class Rainbows::Fiber::Rev::Kato < Rev::TimerWatcher
5
- def initialize
6
- @watch = []
7
- super(1, true)
8
- end
9
-
10
- def <<(fiber)
11
- @watch << fiber
12
- enable unless enabled?
13
- end
14
-
15
- def on_timer
16
- @watch.uniq!
17
- while f = @watch.shift
18
- f.resume if f.alive?
19
- end
20
- disable
21
- end
22
- end
@@ -1,13 +0,0 @@
1
- # -*- encoding: binary -*-
2
- # :enddoc:
3
- require 'rev'
4
- require 'rainbows/fiber'
5
- require 'rainbows/fiber/io'
6
-
7
- module Rainbows::Fiber::Rev
8
- autoload :Heartbeat, 'rainbows/fiber/rev/heartbeat'
9
- autoload :Kato, 'rainbows/fiber/rev/kato'
10
- autoload :Server, 'rainbows/fiber/rev/server'
11
- autoload :Sleeper, 'rainbows/fiber/rev/sleeper'
12
- end
13
- require 'rainbows/fiber/rev/methods'
@@ -1,194 +0,0 @@
1
- # -*- encoding: binary -*-
2
- # :enddoc:
3
- require 'rainbows/ev_core'
4
- module Rainbows
5
- module Rev
6
-
7
- class Client < ::Rev::IO
8
- include Rainbows::EvCore
9
- G = Rainbows::G
10
- F = Rainbows::StreamFile
11
-
12
- def initialize(io)
13
- CONN[self] = false
14
- super(io)
15
- post_init
16
- @deferred = nil
17
- end
18
-
19
- def want_more
20
- enable unless enabled?
21
- end
22
-
23
- def quit
24
- super
25
- close if @deferred.nil? && @_write_buffer.empty?
26
- end
27
-
28
- # override the ::Rev::IO#write method try to write directly to the
29
- # kernel socket buffers to avoid an extra userspace copy if
30
- # possible.
31
- def write(buf)
32
- if @_write_buffer.empty?
33
- begin
34
- case rv = @_io.kgio_trywrite(buf)
35
- when nil
36
- return enable_write_watcher
37
- when :wait_writable
38
- break # fall through to super(buf)
39
- when String
40
- buf = rv # retry, skb could grow or been drained
41
- end
42
- rescue => e
43
- return handle_error(e)
44
- end while true
45
- end
46
- super(buf)
47
- end
48
-
49
- def on_readable
50
- buf = @_io.kgio_tryread(16384)
51
- case buf
52
- when :wait_readable
53
- when nil # eof
54
- close
55
- else
56
- on_read buf
57
- end
58
- rescue Errno::ECONNRESET
59
- close
60
- end
61
-
62
- # queued, optional response bodies, it should only be unpollable "fast"
63
- # devices where read(2) is uninterruptable. Unfortunately, NFS and ilk
64
- # are also part of this. We'll also stick DeferredResponse bodies in
65
- # here to prevent connections from being closed on us.
66
- def defer_body(io)
67
- @deferred = io
68
- enable_write_watcher
69
- end
70
-
71
- # allows enabling of write watcher even when read watcher is disabled
72
- def evloop
73
- Rainbows::Rev::Server::LOOP
74
- end
75
-
76
- def next!
77
- @deferred = nil
78
- enable_write_watcher
79
- end
80
-
81
- def timeout?
82
- @deferred.nil? && @_write_buffer.empty? and close.nil?
83
- end
84
-
85
- # used for streaming sockets and pipes
86
- def stream_response(status, headers, io, body)
87
- c = stream_response_headers(status, headers) if headers
88
- # we only want to attach to the Rev::Loop belonging to the
89
- # main thread in Ruby 1.9
90
- io = (c ? DeferredChunkResponse : DeferredResponse).new(io, self, body)
91
- defer_body(io.attach(Server::LOOP))
92
- end
93
-
94
- def rev_write_response(response, alive)
95
- status, headers, body = response
96
- headers = @hp.headers? ? HH.new(headers) : nil
97
-
98
- headers[CONNECTION] = alive ? KEEP_ALIVE : CLOSE if headers
99
- if body.respond_to?(:to_path)
100
- io = body_to_io(body)
101
- st = io.stat
102
-
103
- if st.file?
104
- offset, count = 0, st.size
105
- if headers
106
- if range = make_range!(@env, status, headers)
107
- status, offset, count = range
108
- end
109
- write(response_header(status, headers))
110
- end
111
- return defer_body(F.new(offset, count, io, body))
112
- elsif st.socket? || st.pipe?
113
- return stream_response(status, headers, io, body)
114
- end
115
- # char or block device... WTF? fall through to body.each
116
- end
117
- write(response_header(status, headers)) if headers
118
- write_body_each(self, body, nil)
119
- end
120
-
121
- def app_call
122
- KATO.delete(self)
123
- @env[RACK_INPUT] = @input
124
- @env[REMOTE_ADDR] = @_io.kgio_addr
125
- response = APP.call(@env.update(RACK_DEFAULTS))
126
-
127
- rev_write_response(response, alive = @hp.keepalive? && G.alive)
128
- return quit unless alive && :close != @state
129
- @hp.reset
130
- @state = :headers
131
- disable if enabled?
132
- end
133
-
134
- def on_write_complete
135
- case @deferred
136
- when DeferredResponse then return
137
- when NilClass # fall through
138
- else
139
- begin
140
- return rev_sendfile(@deferred)
141
- rescue EOFError # expected at file EOF
142
- close_deferred
143
- end
144
- end
145
-
146
- case @state
147
- when :close
148
- close if @_write_buffer.empty?
149
- when :headers
150
- if @buf.empty?
151
- unless enabled?
152
- enable
153
- KATO[self] = Time.now
154
- end
155
- else
156
- on_read("")
157
- end
158
- end
159
- rescue => e
160
- handle_error(e)
161
- end
162
-
163
- def handle_error(e)
164
- close_deferred
165
- if msg = Error.response(e)
166
- @_io.kgio_trywrite(msg) rescue nil
167
- end
168
- @_write_buffer.clear
169
- ensure
170
- quit
171
- end
172
-
173
- def close_deferred
174
- case @deferred
175
- when DeferredResponse, NilClass
176
- else
177
- begin
178
- @deferred.close
179
- rescue => e
180
- G.server.logger.error("closing #@deferred: #{e}")
181
- end
182
- @deferred = nil
183
- end
184
- end
185
-
186
- def on_close
187
- close_deferred
188
- CONN.delete(self)
189
- KATO.delete(self)
190
- end
191
-
192
- end # module Client
193
- end # module Rev
194
- end # module Rainbows
@@ -1,41 +0,0 @@
1
- # -*- encoding: binary -*-
2
- # :enddoc:
3
- require 'rev'
4
- Rev::VERSION >= '0.3.0' or abort 'rev >= 0.3.0 is required'
5
- require 'rainbows/rev/heartbeat'
6
-
7
- module Rainbows
8
- module Rev
9
- class Server < ::Rev::IO
10
- # CL and MAX will be defined in the corresponding worker loop
11
-
12
- def on_readable
13
- return if CONN.size >= MAX
14
- io = @_io.kgio_tryaccept and CL.new(io).attach(LOOP)
15
- end
16
- end # class Server
17
-
18
- module Core
19
- include Base
20
-
21
- # runs inside each forked worker, this sits around and waits
22
- # for connections and doesn't die until the parent dies (or is
23
- # given a INT, QUIT, or TERM signal)
24
- def worker_loop(worker)
25
- Rainbows::Response.setup(Rainbows::Rev::Client)
26
- require 'rainbows/rev/sendfile'
27
- Rainbows::Rev::Client.__send__(:include, Rainbows::Rev::Sendfile)
28
- init_worker_process(worker)
29
- mod = Rainbows.const_get(@use)
30
- rloop = Server.const_set(:LOOP, ::Rev::Loop.default)
31
- Server.const_set(:MAX, @worker_connections)
32
- Server.const_set(:CL, mod.const_get(:Client))
33
- EvCore.const_set(:APP, G.server.app)
34
- Heartbeat.new(1, true).attach(rloop)
35
- LISTENERS.map! { |s| Server.new(s).attach(rloop) }
36
- rloop.run
37
- end
38
-
39
- end # module Core
40
- end # module Rev
41
- end # module Rainbows