eventmachine-le 1.1.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (129) hide show
  1. data/.gitignore +21 -0
  2. data/.yardopts +7 -0
  3. data/GNU +281 -0
  4. data/LICENSE +60 -0
  5. data/README.md +80 -0
  6. data/Rakefile +19 -0
  7. data/eventmachine-le.gemspec +42 -0
  8. data/ext/binder.cpp +124 -0
  9. data/ext/binder.h +46 -0
  10. data/ext/cmain.cpp +841 -0
  11. data/ext/ed.cpp +1995 -0
  12. data/ext/ed.h +424 -0
  13. data/ext/em.cpp +2377 -0
  14. data/ext/em.h +243 -0
  15. data/ext/eventmachine.h +126 -0
  16. data/ext/extconf.rb +166 -0
  17. data/ext/fastfilereader/extconf.rb +94 -0
  18. data/ext/fastfilereader/mapper.cpp +214 -0
  19. data/ext/fastfilereader/mapper.h +59 -0
  20. data/ext/fastfilereader/rubymain.cpp +127 -0
  21. data/ext/kb.cpp +79 -0
  22. data/ext/page.cpp +107 -0
  23. data/ext/page.h +51 -0
  24. data/ext/pipe.cpp +347 -0
  25. data/ext/project.h +155 -0
  26. data/ext/rubymain.cpp +1269 -0
  27. data/ext/ssl.cpp +468 -0
  28. data/ext/ssl.h +94 -0
  29. data/lib/em/buftok.rb +110 -0
  30. data/lib/em/callback.rb +58 -0
  31. data/lib/em/channel.rb +64 -0
  32. data/lib/em/completion.rb +304 -0
  33. data/lib/em/connection.rb +728 -0
  34. data/lib/em/deferrable.rb +210 -0
  35. data/lib/em/deferrable/pool.rb +2 -0
  36. data/lib/em/file_watch.rb +73 -0
  37. data/lib/em/future.rb +61 -0
  38. data/lib/em/iterator.rb +313 -0
  39. data/lib/em/messages.rb +66 -0
  40. data/lib/em/pool.rb +151 -0
  41. data/lib/em/process_watch.rb +45 -0
  42. data/lib/em/processes.rb +123 -0
  43. data/lib/em/protocols.rb +37 -0
  44. data/lib/em/protocols/header_and_content.rb +138 -0
  45. data/lib/em/protocols/httpclient.rb +279 -0
  46. data/lib/em/protocols/httpclient2.rb +600 -0
  47. data/lib/em/protocols/line_and_text.rb +125 -0
  48. data/lib/em/protocols/line_protocol.rb +29 -0
  49. data/lib/em/protocols/linetext2.rb +161 -0
  50. data/lib/em/protocols/memcache.rb +331 -0
  51. data/lib/em/protocols/object_protocol.rb +46 -0
  52. data/lib/em/protocols/postgres3.rb +246 -0
  53. data/lib/em/protocols/saslauth.rb +175 -0
  54. data/lib/em/protocols/smtpclient.rb +365 -0
  55. data/lib/em/protocols/smtpserver.rb +663 -0
  56. data/lib/em/protocols/socks4.rb +66 -0
  57. data/lib/em/protocols/stomp.rb +202 -0
  58. data/lib/em/protocols/tcptest.rb +54 -0
  59. data/lib/em/queue.rb +71 -0
  60. data/lib/em/resolver.rb +195 -0
  61. data/lib/em/spawnable.rb +84 -0
  62. data/lib/em/streamer.rb +118 -0
  63. data/lib/em/threaded_resource.rb +90 -0
  64. data/lib/em/tick_loop.rb +85 -0
  65. data/lib/em/timers.rb +106 -0
  66. data/lib/em/version.rb +3 -0
  67. data/lib/eventmachine-le.rb +10 -0
  68. data/lib/eventmachine.rb +1548 -0
  69. data/rakelib/cpp.rake_example +77 -0
  70. data/rakelib/package.rake +98 -0
  71. data/rakelib/test.rake +8 -0
  72. data/tests/client.crt +31 -0
  73. data/tests/client.key +51 -0
  74. data/tests/em_test_helper.rb +143 -0
  75. data/tests/test_attach.rb +148 -0
  76. data/tests/test_basic.rb +294 -0
  77. data/tests/test_channel.rb +62 -0
  78. data/tests/test_completion.rb +177 -0
  79. data/tests/test_connection_count.rb +33 -0
  80. data/tests/test_defer.rb +18 -0
  81. data/tests/test_deferrable.rb +35 -0
  82. data/tests/test_epoll.rb +134 -0
  83. data/tests/test_error_handler.rb +38 -0
  84. data/tests/test_exc.rb +28 -0
  85. data/tests/test_file_watch.rb +65 -0
  86. data/tests/test_futures.rb +170 -0
  87. data/tests/test_get_sock_opt.rb +37 -0
  88. data/tests/test_handler_check.rb +35 -0
  89. data/tests/test_hc.rb +155 -0
  90. data/tests/test_httpclient.rb +190 -0
  91. data/tests/test_httpclient2.rb +128 -0
  92. data/tests/test_inactivity_timeout.rb +54 -0
  93. data/tests/test_ipv4.rb +125 -0
  94. data/tests/test_ipv6.rb +131 -0
  95. data/tests/test_iterator.rb +110 -0
  96. data/tests/test_kb.rb +34 -0
  97. data/tests/test_line_protocol.rb +33 -0
  98. data/tests/test_ltp.rb +138 -0
  99. data/tests/test_ltp2.rb +288 -0
  100. data/tests/test_next_tick.rb +104 -0
  101. data/tests/test_object_protocol.rb +36 -0
  102. data/tests/test_pause.rb +78 -0
  103. data/tests/test_pending_connect_timeout.rb +52 -0
  104. data/tests/test_pool.rb +196 -0
  105. data/tests/test_process_watch.rb +48 -0
  106. data/tests/test_processes.rb +133 -0
  107. data/tests/test_proxy_connection.rb +168 -0
  108. data/tests/test_pure.rb +88 -0
  109. data/tests/test_queue.rb +50 -0
  110. data/tests/test_resolver.rb +55 -0
  111. data/tests/test_running.rb +14 -0
  112. data/tests/test_sasl.rb +47 -0
  113. data/tests/test_send_file.rb +217 -0
  114. data/tests/test_servers.rb +33 -0
  115. data/tests/test_set_sock_opt.rb +41 -0
  116. data/tests/test_shutdown_hooks.rb +23 -0
  117. data/tests/test_smtpclient.rb +55 -0
  118. data/tests/test_smtpserver.rb +120 -0
  119. data/tests/test_spawn.rb +293 -0
  120. data/tests/test_ssl_args.rb +78 -0
  121. data/tests/test_ssl_methods.rb +48 -0
  122. data/tests/test_ssl_verify.rb +82 -0
  123. data/tests/test_threaded_resource.rb +55 -0
  124. data/tests/test_tick_loop.rb +59 -0
  125. data/tests/test_timers.rb +180 -0
  126. data/tests/test_ud.rb +8 -0
  127. data/tests/test_udp46.rb +53 -0
  128. data/tests/test_unbind_reason.rb +48 -0
  129. metadata +390 -0
@@ -0,0 +1,48 @@
1
+ require 'em_test_helper'
2
+ require 'socket'
3
+
4
+ class TestUnbindReason < Test::Unit::TestCase
5
+
6
+ class StubConnection < EM::Connection
7
+ attr_reader :error
8
+ def unbind(reason = nil)
9
+ @error = reason
10
+ EM.stop
11
+ end
12
+ end
13
+
14
+ def test_connect_timeout
15
+ error = nil
16
+ EM.run {
17
+ conn = EM.connect 'google.com', 81, Module.new{ |m|
18
+ m.send(:define_method, :unbind) do |reason|
19
+ error = reason
20
+ EM.stop
21
+ end
22
+ }
23
+ conn.pending_connect_timeout = 0.1
24
+ }
25
+ assert_equal Errno::ETIMEDOUT, error
26
+ end
27
+
28
+ def test_connect_refused
29
+ error = nil
30
+ EM.run {
31
+ EM.connect '127.0.0.1', 12388, Module.new{ |m|
32
+ m.send(:define_method, :unbind) do |reason|
33
+ error = reason
34
+ EM.stop
35
+ end
36
+ }
37
+ }
38
+ assert_equal Errno::ECONNREFUSED, error
39
+ end
40
+
41
+ def test_optional_argument
42
+ conn = nil
43
+ EM.run {
44
+ conn = EM.connect '127.0.0.1', 12388, StubConnection
45
+ }
46
+ assert_equal Errno::ECONNREFUSED, conn.error
47
+ end
48
+ end
metadata ADDED
@@ -0,0 +1,390 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: eventmachine-le
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: true
5
+ segments:
6
+ - 1
7
+ - 1
8
+ - 0
9
+ - beta
10
+ - 1
11
+ version: 1.1.0.beta.1
12
+ platform: ruby
13
+ authors:
14
+ - Francis Cianfrocca
15
+ - Aman Gupta
16
+ - hacked by Carsten Bormann and Inaki Baz Castillo
17
+ autorequire:
18
+ bindir: bin
19
+ cert_chain: []
20
+
21
+ date: 2012-03-04 00:00:00 +01:00
22
+ default_executable:
23
+ dependencies:
24
+ - !ruby/object:Gem::Dependency
25
+ name: rake-compiler
26
+ prerelease: false
27
+ requirement: &id001 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - "="
31
+ - !ruby/object:Gem::Version
32
+ segments:
33
+ - 0
34
+ - 7
35
+ - 9
36
+ version: 0.7.9
37
+ type: :development
38
+ version_requirements: *id001
39
+ - !ruby/object:Gem::Dependency
40
+ name: yard
41
+ prerelease: false
42
+ requirement: &id002 !ruby/object:Gem::Requirement
43
+ none: false
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ segments:
48
+ - 0
49
+ - 7
50
+ - 2
51
+ version: 0.7.2
52
+ type: :development
53
+ version_requirements: *id002
54
+ - !ruby/object:Gem::Dependency
55
+ name: bluecloth
56
+ prerelease: false
57
+ requirement: &id003 !ruby/object:Gem::Requirement
58
+ none: false
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ segments:
63
+ - 0
64
+ version: "0"
65
+ type: :development
66
+ version_requirements: *id003
67
+ description: |
68
+ EventMachine-LE (Live Edition) is a branch of EventMachine (https://github.com/eventmachine/eventmachine).
69
+
70
+ This branch incorporates interesting pull requests that are not yet included in the mainline EventMachine repository. The maintainers of that version prefer to minimize change in order to keep the stability with already existing EventMachine deployments, which provides an impressive multi-platform base for IPv4 TCP servers (e.g., Web servers) that don't need good UDP or IPv6 support.
71
+
72
+ This dedication to stability is helpful for production use, but can also lead to ossification. The present "Live Edition" or "Leading Edge" branch has its focus on supporting a somewhat wider use, including new Web servers or protocols beyond the HTTP Web.
73
+
74
+ To provide even more focus, this branch is currently applying its energy towards Linux and Unix/BSD/OSX environments. Java reactor and pure Ruby reactor are for now removed in this branch, and Windows/Cygwin support is untested. This may very well change later, once interesting pull requests come in.
75
+
76
+ EventMachine-LE draws from a number of dormant pull requests on the mainline version of EventMachine. New proposals will also directly come to EventMachine-LE and will be included once they are tested.
77
+
78
+ This is not a "development branch", EventMachine-LE is ready for production, just beyond the focus of mainline EventMachine.
79
+
80
+ email:
81
+ - garbagecat10@gmail.com
82
+ - aman@tmm1.net
83
+ - cabo@tzi.org
84
+ - ibc@aliax.net
85
+ executables: []
86
+
87
+ extensions:
88
+ - ext/extconf.rb
89
+ - ext/fastfilereader/extconf.rb
90
+ extra_rdoc_files:
91
+ - README.md
92
+ - .gitignore
93
+ - .yardopts
94
+ - GNU
95
+ - LICENSE
96
+ - Rakefile
97
+ - eventmachine-le.gemspec
98
+ - ext/binder.cpp
99
+ - ext/binder.h
100
+ - ext/cmain.cpp
101
+ - ext/ed.cpp
102
+ - ext/ed.h
103
+ - ext/em.cpp
104
+ - ext/em.h
105
+ - ext/eventmachine.h
106
+ - ext/extconf.rb
107
+ - ext/fastfilereader/extconf.rb
108
+ - ext/fastfilereader/mapper.cpp
109
+ - ext/fastfilereader/mapper.h
110
+ - ext/fastfilereader/rubymain.cpp
111
+ - ext/kb.cpp
112
+ - ext/page.cpp
113
+ - ext/page.h
114
+ - ext/pipe.cpp
115
+ - ext/project.h
116
+ - ext/rubymain.cpp
117
+ - ext/ssl.cpp
118
+ - ext/ssl.h
119
+ - lib/em/buftok.rb
120
+ - lib/em/callback.rb
121
+ - lib/em/channel.rb
122
+ - lib/em/completion.rb
123
+ - lib/em/connection.rb
124
+ - lib/em/deferrable.rb
125
+ - lib/em/deferrable/pool.rb
126
+ - lib/em/file_watch.rb
127
+ - lib/em/future.rb
128
+ - lib/em/iterator.rb
129
+ - lib/em/messages.rb
130
+ - lib/em/pool.rb
131
+ - lib/em/process_watch.rb
132
+ - lib/em/processes.rb
133
+ - lib/em/protocols.rb
134
+ - lib/em/protocols/header_and_content.rb
135
+ - lib/em/protocols/httpclient.rb
136
+ - lib/em/protocols/httpclient2.rb
137
+ - lib/em/protocols/line_and_text.rb
138
+ - lib/em/protocols/line_protocol.rb
139
+ - lib/em/protocols/linetext2.rb
140
+ - lib/em/protocols/memcache.rb
141
+ - lib/em/protocols/object_protocol.rb
142
+ - lib/em/protocols/postgres3.rb
143
+ - lib/em/protocols/saslauth.rb
144
+ - lib/em/protocols/smtpclient.rb
145
+ - lib/em/protocols/smtpserver.rb
146
+ - lib/em/protocols/socks4.rb
147
+ - lib/em/protocols/stomp.rb
148
+ - lib/em/protocols/tcptest.rb
149
+ - lib/em/queue.rb
150
+ - lib/em/resolver.rb
151
+ - lib/em/spawnable.rb
152
+ - lib/em/streamer.rb
153
+ - lib/em/threaded_resource.rb
154
+ - lib/em/tick_loop.rb
155
+ - lib/em/timers.rb
156
+ - lib/em/version.rb
157
+ - lib/eventmachine-le.rb
158
+ - lib/eventmachine.rb
159
+ - rakelib/cpp.rake_example
160
+ - rakelib/package.rake
161
+ - rakelib/test.rake
162
+ - tests/client.crt
163
+ - tests/client.key
164
+ - tests/em_test_helper.rb
165
+ - tests/test_attach.rb
166
+ - tests/test_basic.rb
167
+ - tests/test_channel.rb
168
+ - tests/test_completion.rb
169
+ - tests/test_connection_count.rb
170
+ - tests/test_defer.rb
171
+ - tests/test_deferrable.rb
172
+ - tests/test_epoll.rb
173
+ - tests/test_error_handler.rb
174
+ - tests/test_exc.rb
175
+ - tests/test_file_watch.rb
176
+ - tests/test_futures.rb
177
+ - tests/test_get_sock_opt.rb
178
+ - tests/test_handler_check.rb
179
+ - tests/test_hc.rb
180
+ - tests/test_httpclient.rb
181
+ - tests/test_httpclient2.rb
182
+ - tests/test_inactivity_timeout.rb
183
+ - tests/test_ipv4.rb
184
+ - tests/test_ipv6.rb
185
+ - tests/test_iterator.rb
186
+ - tests/test_kb.rb
187
+ - tests/test_line_protocol.rb
188
+ - tests/test_ltp.rb
189
+ - tests/test_ltp2.rb
190
+ - tests/test_next_tick.rb
191
+ - tests/test_object_protocol.rb
192
+ - tests/test_pause.rb
193
+ - tests/test_pending_connect_timeout.rb
194
+ - tests/test_pool.rb
195
+ - tests/test_process_watch.rb
196
+ - tests/test_processes.rb
197
+ - tests/test_proxy_connection.rb
198
+ - tests/test_pure.rb
199
+ - tests/test_queue.rb
200
+ - tests/test_resolver.rb
201
+ - tests/test_running.rb
202
+ - tests/test_sasl.rb
203
+ - tests/test_send_file.rb
204
+ - tests/test_servers.rb
205
+ - tests/test_set_sock_opt.rb
206
+ - tests/test_shutdown_hooks.rb
207
+ - tests/test_smtpclient.rb
208
+ - tests/test_smtpserver.rb
209
+ - tests/test_spawn.rb
210
+ - tests/test_ssl_args.rb
211
+ - tests/test_ssl_methods.rb
212
+ - tests/test_ssl_verify.rb
213
+ - tests/test_threaded_resource.rb
214
+ - tests/test_tick_loop.rb
215
+ - tests/test_timers.rb
216
+ - tests/test_ud.rb
217
+ - tests/test_udp46.rb
218
+ - tests/test_unbind_reason.rb
219
+ files:
220
+ - .gitignore
221
+ - .yardopts
222
+ - GNU
223
+ - LICENSE
224
+ - README.md
225
+ - Rakefile
226
+ - eventmachine-le.gemspec
227
+ - ext/binder.cpp
228
+ - ext/binder.h
229
+ - ext/cmain.cpp
230
+ - ext/ed.cpp
231
+ - ext/ed.h
232
+ - ext/em.cpp
233
+ - ext/em.h
234
+ - ext/eventmachine.h
235
+ - ext/extconf.rb
236
+ - ext/fastfilereader/extconf.rb
237
+ - ext/fastfilereader/mapper.cpp
238
+ - ext/fastfilereader/mapper.h
239
+ - ext/fastfilereader/rubymain.cpp
240
+ - ext/kb.cpp
241
+ - ext/page.cpp
242
+ - ext/page.h
243
+ - ext/pipe.cpp
244
+ - ext/project.h
245
+ - ext/rubymain.cpp
246
+ - ext/ssl.cpp
247
+ - ext/ssl.h
248
+ - lib/em/buftok.rb
249
+ - lib/em/callback.rb
250
+ - lib/em/channel.rb
251
+ - lib/em/completion.rb
252
+ - lib/em/connection.rb
253
+ - lib/em/deferrable.rb
254
+ - lib/em/deferrable/pool.rb
255
+ - lib/em/file_watch.rb
256
+ - lib/em/future.rb
257
+ - lib/em/iterator.rb
258
+ - lib/em/messages.rb
259
+ - lib/em/pool.rb
260
+ - lib/em/process_watch.rb
261
+ - lib/em/processes.rb
262
+ - lib/em/protocols.rb
263
+ - lib/em/protocols/header_and_content.rb
264
+ - lib/em/protocols/httpclient.rb
265
+ - lib/em/protocols/httpclient2.rb
266
+ - lib/em/protocols/line_and_text.rb
267
+ - lib/em/protocols/line_protocol.rb
268
+ - lib/em/protocols/linetext2.rb
269
+ - lib/em/protocols/memcache.rb
270
+ - lib/em/protocols/object_protocol.rb
271
+ - lib/em/protocols/postgres3.rb
272
+ - lib/em/protocols/saslauth.rb
273
+ - lib/em/protocols/smtpclient.rb
274
+ - lib/em/protocols/smtpserver.rb
275
+ - lib/em/protocols/socks4.rb
276
+ - lib/em/protocols/stomp.rb
277
+ - lib/em/protocols/tcptest.rb
278
+ - lib/em/queue.rb
279
+ - lib/em/resolver.rb
280
+ - lib/em/spawnable.rb
281
+ - lib/em/streamer.rb
282
+ - lib/em/threaded_resource.rb
283
+ - lib/em/tick_loop.rb
284
+ - lib/em/timers.rb
285
+ - lib/em/version.rb
286
+ - lib/eventmachine-le.rb
287
+ - lib/eventmachine.rb
288
+ - rakelib/cpp.rake_example
289
+ - rakelib/package.rake
290
+ - rakelib/test.rake
291
+ - tests/client.crt
292
+ - tests/client.key
293
+ - tests/em_test_helper.rb
294
+ - tests/test_attach.rb
295
+ - tests/test_basic.rb
296
+ - tests/test_channel.rb
297
+ - tests/test_completion.rb
298
+ - tests/test_connection_count.rb
299
+ - tests/test_defer.rb
300
+ - tests/test_deferrable.rb
301
+ - tests/test_epoll.rb
302
+ - tests/test_error_handler.rb
303
+ - tests/test_exc.rb
304
+ - tests/test_file_watch.rb
305
+ - tests/test_futures.rb
306
+ - tests/test_get_sock_opt.rb
307
+ - tests/test_handler_check.rb
308
+ - tests/test_hc.rb
309
+ - tests/test_httpclient.rb
310
+ - tests/test_httpclient2.rb
311
+ - tests/test_inactivity_timeout.rb
312
+ - tests/test_ipv4.rb
313
+ - tests/test_ipv6.rb
314
+ - tests/test_iterator.rb
315
+ - tests/test_kb.rb
316
+ - tests/test_line_protocol.rb
317
+ - tests/test_ltp.rb
318
+ - tests/test_ltp2.rb
319
+ - tests/test_next_tick.rb
320
+ - tests/test_object_protocol.rb
321
+ - tests/test_pause.rb
322
+ - tests/test_pending_connect_timeout.rb
323
+ - tests/test_pool.rb
324
+ - tests/test_process_watch.rb
325
+ - tests/test_processes.rb
326
+ - tests/test_proxy_connection.rb
327
+ - tests/test_pure.rb
328
+ - tests/test_queue.rb
329
+ - tests/test_resolver.rb
330
+ - tests/test_running.rb
331
+ - tests/test_sasl.rb
332
+ - tests/test_send_file.rb
333
+ - tests/test_servers.rb
334
+ - tests/test_set_sock_opt.rb
335
+ - tests/test_shutdown_hooks.rb
336
+ - tests/test_smtpclient.rb
337
+ - tests/test_smtpserver.rb
338
+ - tests/test_spawn.rb
339
+ - tests/test_ssl_args.rb
340
+ - tests/test_ssl_methods.rb
341
+ - tests/test_ssl_verify.rb
342
+ - tests/test_threaded_resource.rb
343
+ - tests/test_tick_loop.rb
344
+ - tests/test_timers.rb
345
+ - tests/test_ud.rb
346
+ - tests/test_udp46.rb
347
+ - tests/test_unbind_reason.rb
348
+ has_rdoc: true
349
+ homepage: https://github.com/ibc/EventMachine-LE/
350
+ licenses: []
351
+
352
+ post_install_message:
353
+ rdoc_options:
354
+ - --title
355
+ - EventMachine-LE
356
+ - --main
357
+ - README.md
358
+ - -x
359
+ - lib/em/version
360
+ require_paths:
361
+ - lib
362
+ required_ruby_version: !ruby/object:Gem::Requirement
363
+ none: false
364
+ requirements:
365
+ - - ">="
366
+ - !ruby/object:Gem::Version
367
+ segments:
368
+ - 1
369
+ - 8
370
+ - 7
371
+ version: 1.8.7
372
+ required_rubygems_version: !ruby/object:Gem::Requirement
373
+ none: false
374
+ requirements:
375
+ - - ">"
376
+ - !ruby/object:Gem::Version
377
+ segments:
378
+ - 1
379
+ - 3
380
+ - 1
381
+ version: 1.3.1
382
+ requirements: []
383
+
384
+ rubyforge_project:
385
+ rubygems_version: 1.3.7
386
+ signing_key:
387
+ specification_version: 3
388
+ summary: EventMachine LE (Live Edition)
389
+ test_files: []
390
+