eventmachine 0.12.2 → 0.12.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +191 -0
- data/{COPYING → docs/COPYING} +0 -0
- data/docs/ChangeLog +183 -0
- data/{DEFERRABLES → docs/DEFERRABLES} +1 -1
- data/{EPOLL → docs/EPOLL} +0 -0
- data/{GNU → docs/GNU} +0 -0
- data/docs/INSTALL +15 -0
- data/{KEYBOARD → docs/KEYBOARD} +0 -0
- data/{LEGAL → docs/LEGAL} +0 -0
- data/{LIGHTWEIGHT_CONCURRENCY → docs/LIGHTWEIGHT_CONCURRENCY} +1 -1
- data/{PURE_RUBY → docs/PURE_RUBY} +1 -1
- data/{README → docs/README} +1 -1
- data/{RELEASE_NOTES → docs/RELEASE_NOTES} +1 -1
- data/{SMTP → docs/SMTP} +1 -1
- data/{SPAWNED_PROCESSES → docs/SPAWNED_PROCESSES} +1 -1
- data/{TODO → docs/TODO} +1 -1
- data/ext/binder.cpp +1 -1
- data/ext/binder.h +1 -1
- data/ext/cmain.cpp +65 -74
- data/ext/cplusplus.cpp +1 -1
- data/ext/ed.cpp +41 -25
- data/ext/ed.h +10 -3
- data/ext/em.cpp +39 -12
- data/ext/em.h +13 -1
- data/ext/emwin.cpp +1 -1
- data/ext/emwin.h +1 -1
- data/ext/epoll.cpp +1 -1
- data/ext/epoll.h +1 -1
- data/ext/eventmachine.h +1 -1
- data/ext/eventmachine_cpp.h +1 -1
- data/ext/extconf.rb +86 -139
- data/ext/fastfilereader/extconf.rb +161 -0
- data/ext/fastfilereader/mapper.cpp +202 -0
- data/ext/fastfilereader/mapper.h +59 -0
- data/ext/fastfilereader/rubymain.cpp +127 -0
- data/ext/files.cpp +1 -1
- data/ext/files.h +1 -1
- data/ext/kb.cpp +1 -1
- data/ext/page.cpp +1 -1
- data/ext/page.h +1 -1
- data/ext/pipe.cpp +14 -7
- data/ext/project.h +1 -1
- data/ext/rubymain.cpp +56 -2
- data/ext/sigs.cpp +1 -1
- data/ext/sigs.h +1 -1
- data/ext/ssl.cpp +1 -1
- data/ext/ssl.h +1 -1
- data/java/src/com/rubyeventmachine/Application.java +196 -0
- data/java/src/com/rubyeventmachine/Connection.java +74 -0
- data/java/src/com/rubyeventmachine/ConnectionFactory.java +37 -0
- data/java/src/com/rubyeventmachine/DefaultConnectionFactory.java +46 -0
- data/java/src/com/rubyeventmachine/EmReactor.java +408 -0
- data/java/src/com/rubyeventmachine/EmReactorException.java +40 -0
- data/java/src/com/rubyeventmachine/EventableChannel.java +57 -0
- data/java/src/com/rubyeventmachine/EventableDatagramChannel.java +171 -0
- data/java/src/com/rubyeventmachine/EventableSocketChannel.java +244 -0
- data/java/src/com/rubyeventmachine/PeriodicTimer.java +38 -0
- data/java/src/com/rubyeventmachine/Timer.java +54 -0
- data/java/src/com/rubyeventmachine/tests/ApplicationTest.java +108 -0
- data/java/src/com/rubyeventmachine/tests/ConnectTest.java +124 -0
- data/java/src/com/rubyeventmachine/tests/EMTest.java +80 -0
- data/java/src/com/rubyeventmachine/tests/TestDatagrams.java +53 -0
- data/java/src/com/rubyeventmachine/tests/TestServers.java +74 -0
- data/java/src/com/rubyeventmachine/tests/TestTimers.java +89 -0
- data/lib/em/deferrable.rb +1 -1
- data/lib/em/eventable.rb +1 -1
- data/lib/em/future.rb +1 -1
- data/lib/em/messages.rb +1 -1
- data/lib/em/processes.rb +1 -1
- data/lib/em/spawnable.rb +1 -1
- data/lib/em/streamer.rb +1 -1
- data/lib/eventmachine.rb +138 -116
- data/lib/eventmachine_version.rb +2 -2
- data/lib/evma.rb +1 -1
- data/lib/evma/callback.rb +1 -1
- data/lib/evma/container.rb +1 -1
- data/lib/evma/factory.rb +1 -1
- data/lib/evma/protocol.rb +1 -1
- data/lib/evma/reactor.rb +1 -1
- data/lib/jeventmachine.rb +7 -2
- data/lib/pr_eventmachine.rb +2 -2
- data/lib/protocols/buftok.rb +1 -1
- data/lib/protocols/header_and_content.rb +1 -1
- data/lib/protocols/httpcli2.rb +16 -6
- data/lib/protocols/httpclient.rb +7 -1
- data/lib/protocols/line_and_text.rb +6 -2
- data/lib/protocols/linetext2.rb +12 -14
- data/lib/protocols/postgres.rb +1 -1
- data/lib/protocols/saslauth.rb +1 -1
- data/lib/protocols/smtpclient.rb +1 -1
- data/lib/protocols/smtpserver.rb +36 -23
- data/lib/protocols/stomp.rb +24 -1
- data/lib/protocols/tcptest.rb +1 -1
- data/tasks/cpp.rake +77 -0
- data/tasks/project.rake +78 -0
- data/tasks/tests.rake +192 -0
- data/tests/test_attach.rb +1 -1
- data/tests/test_basic.rb +65 -12
- data/tests/test_defer.rb +13 -29
- data/tests/test_epoll.rb +16 -21
- data/tests/test_errors.rb +1 -1
- data/tests/test_eventables.rb +4 -5
- data/tests/test_exc.rb +1 -1
- data/tests/test_futures.rb +1 -1
- data/tests/test_hc.rb +185 -236
- data/tests/test_httpclient.rb +1 -1
- data/tests/test_httpclient2.rb +28 -6
- data/tests/test_kb.rb +2 -2
- data/tests/test_ltp.rb +139 -141
- data/tests/test_ltp2.rb +1 -1
- data/tests/test_next_tick.rb +1 -1
- data/tests/test_processes.rb +1 -1
- data/tests/test_pure.rb +3 -2
- data/tests/test_running.rb +1 -1
- data/tests/test_sasl.rb +1 -1
- data/tests/test_send_file.rb +56 -51
- data/tests/test_servers.rb +26 -36
- data/tests/test_smtpclient.rb +46 -44
- data/tests/test_smtpserver.rb +1 -1
- data/tests/test_spawn.rb +1 -1
- data/tests/test_ssl_args.rb +68 -0
- data/tests/test_timers.rb +15 -9
- data/tests/test_ud.rb +1 -1
- data/tests/testem.rb +30 -4
- metadata +69 -34
data/tests/test_timers.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id
|
1
|
+
# $Id$
|
2
2
|
#
|
3
3
|
# Author:: Francis Cianfrocca (gmail: blackhedd)
|
4
4
|
# Homepage:: http://rubyeventmachine.com
|
@@ -73,10 +73,10 @@ class TestTimers < Test::Unit::TestCase
|
|
73
73
|
def test_periodic_timer
|
74
74
|
x = 0
|
75
75
|
EventMachine.run {
|
76
|
-
EventMachine::PeriodicTimer.new(0.1
|
76
|
+
EventMachine::PeriodicTimer.new(0.1) do
|
77
77
|
x += 1
|
78
|
-
|
79
|
-
|
78
|
+
EventMachine.stop if x == 4
|
79
|
+
end
|
80
80
|
}
|
81
81
|
assert( x == 4 )
|
82
82
|
end
|
@@ -84,7 +84,7 @@ class TestTimers < Test::Unit::TestCase
|
|
84
84
|
def test_periodic_timer_cancel
|
85
85
|
x = 0
|
86
86
|
EventMachine.run {
|
87
|
-
pt = EventMachine::PeriodicTimer.new(
|
87
|
+
pt = EventMachine::PeriodicTimer.new(0.25, proc { x += 1 })
|
88
88
|
pt.cancel
|
89
89
|
EventMachine::Timer.new(0.5) {EventMachine.stop}
|
90
90
|
}
|
@@ -121,14 +121,20 @@ class TestTimers < Test::Unit::TestCase
|
|
121
121
|
elsif EM.library_type == :java
|
122
122
|
ten_thousand_timers.call
|
123
123
|
else
|
124
|
-
|
125
|
-
|
126
|
-
|
124
|
+
begin
|
125
|
+
assert_raise( RuntimeError ) {
|
126
|
+
ten_thousand_timers.call
|
127
|
+
}
|
128
|
+
rescue Object
|
129
|
+
p $!
|
130
|
+
assert(false, $!.message)
|
131
|
+
end
|
127
132
|
end
|
128
133
|
EM.stop
|
129
134
|
}
|
130
135
|
|
131
|
-
|
136
|
+
assert(!EM.reactor_running?, 'Reactor running when it should not be.')
|
137
|
+
EM.set_max_timers( 10001 )
|
132
138
|
|
133
139
|
EM.run {
|
134
140
|
ten_thousand_timers.call
|
data/tests/test_ud.rb
CHANGED
data/tests/testem.rb
CHANGED
@@ -1,5 +1,31 @@
|
|
1
|
-
# $Id
|
2
|
-
#
|
3
|
-
# STUB
|
4
|
-
#
|
1
|
+
# $Id$
|
5
2
|
|
3
|
+
require 'test/unit'
|
4
|
+
|
5
|
+
module EmTestRunner
|
6
|
+
@em_root = File.expand_path(File.dirname(__FILE__) + '/../')
|
7
|
+
@lib_dir = File.join(@em_root, 'lib')
|
8
|
+
@ext_dir = File.join(@em_root, 'ext')
|
9
|
+
@java_dir = File.join(@em_root, 'java')
|
10
|
+
|
11
|
+
def self.run(glob = 'test_*.rb')
|
12
|
+
$:.unshift(@lib_dir)
|
13
|
+
$:.unshift(@ext_dir)
|
14
|
+
$:.unshift(@java_dir)
|
15
|
+
|
16
|
+
case glob
|
17
|
+
when Array
|
18
|
+
files = glob
|
19
|
+
else
|
20
|
+
files = Dir[File.dirname(__FILE__) + '/' + glob]
|
21
|
+
end
|
22
|
+
|
23
|
+
files.each do |tc|
|
24
|
+
require tc
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
if __FILE__ == $0
|
30
|
+
EmTestRunner.run
|
31
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eventmachine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Francis Cianfrocca
|
@@ -9,31 +9,34 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2009-02-08 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
16
|
-
description:
|
16
|
+
description: EventMachine implements a fast, single-threaded engine for arbitrary network communications. It's extremely easy to use in Ruby. EventMachine wraps all interactions with IP sockets, allowing programs to concentrate on the implementation of network protocols. It can be used to create both network servers and clients. To create a server or client, a Ruby program only needs to specify the IP address and port, and provide a Module that implements the communications protocol. Implementations of several standard network protocols are provided with the package, primarily to serve as examples. The real goal of EventMachine is to enable programs to easily interface with other programs using TCP/IP, especially if custom protocols are required.
|
17
17
|
email: garbagecat10@gmail.com
|
18
18
|
executables: []
|
19
19
|
|
20
20
|
extensions:
|
21
|
-
-
|
21
|
+
- Rakefile
|
22
22
|
extra_rdoc_files:
|
23
|
-
-
|
24
|
-
-
|
25
|
-
-
|
26
|
-
- EPOLL
|
27
|
-
- GNU
|
28
|
-
-
|
29
|
-
-
|
30
|
-
-
|
31
|
-
- LIGHTWEIGHT_CONCURRENCY
|
32
|
-
- PURE_RUBY
|
33
|
-
-
|
34
|
-
-
|
35
|
-
-
|
23
|
+
- docs/ChangeLog
|
24
|
+
- docs/COPYING
|
25
|
+
- docs/DEFERRABLES
|
26
|
+
- docs/EPOLL
|
27
|
+
- docs/GNU
|
28
|
+
- docs/INSTALL
|
29
|
+
- docs/KEYBOARD
|
30
|
+
- docs/LEGAL
|
31
|
+
- docs/LIGHTWEIGHT_CONCURRENCY
|
32
|
+
- docs/PURE_RUBY
|
33
|
+
- docs/README
|
34
|
+
- docs/RELEASE_NOTES
|
35
|
+
- docs/SMTP
|
36
|
+
- docs/SPAWNED_PROCESSES
|
37
|
+
- docs/TODO
|
36
38
|
files:
|
39
|
+
- Rakefile
|
37
40
|
- tests/test_attach.rb
|
38
41
|
- tests/test_basic.rb
|
39
42
|
- tests/test_defer.rb
|
@@ -58,6 +61,7 @@ files:
|
|
58
61
|
- tests/test_smtpclient.rb
|
59
62
|
- tests/test_smtpserver.rb
|
60
63
|
- tests/test_spawn.rb
|
64
|
+
- tests/test_ssl_args.rb
|
61
65
|
- tests/test_timers.rb
|
62
66
|
- tests/test_ud.rb
|
63
67
|
- tests/testem.rb
|
@@ -108,6 +112,11 @@ files:
|
|
108
112
|
- ext/eventmachine.h
|
109
113
|
- ext/eventmachine_cpp.h
|
110
114
|
- ext/extconf.rb
|
115
|
+
- ext/fastfilereader
|
116
|
+
- ext/fastfilereader/extconf.rb
|
117
|
+
- ext/fastfilereader/mapper.cpp
|
118
|
+
- ext/fastfilereader/mapper.h
|
119
|
+
- ext/fastfilereader/rubymain.cpp
|
111
120
|
- ext/files.cpp
|
112
121
|
- ext/files.h
|
113
122
|
- ext/kb.cpp
|
@@ -120,19 +129,45 @@ files:
|
|
120
129
|
- ext/sigs.h
|
121
130
|
- ext/ssl.cpp
|
122
131
|
- ext/ssl.h
|
123
|
-
-
|
124
|
-
-
|
125
|
-
-
|
126
|
-
-
|
127
|
-
-
|
128
|
-
-
|
129
|
-
-
|
130
|
-
-
|
131
|
-
-
|
132
|
-
-
|
133
|
-
-
|
134
|
-
-
|
135
|
-
-
|
132
|
+
- java/src
|
133
|
+
- java/src/com
|
134
|
+
- java/src/com/rubyeventmachine
|
135
|
+
- java/src/com/rubyeventmachine/Application.java
|
136
|
+
- java/src/com/rubyeventmachine/Connection.java
|
137
|
+
- java/src/com/rubyeventmachine/ConnectionFactory.java
|
138
|
+
- java/src/com/rubyeventmachine/DefaultConnectionFactory.java
|
139
|
+
- java/src/com/rubyeventmachine/EmReactor.java
|
140
|
+
- java/src/com/rubyeventmachine/EmReactorException.java
|
141
|
+
- java/src/com/rubyeventmachine/EventableChannel.java
|
142
|
+
- java/src/com/rubyeventmachine/EventableDatagramChannel.java
|
143
|
+
- java/src/com/rubyeventmachine/EventableSocketChannel.java
|
144
|
+
- java/src/com/rubyeventmachine/PeriodicTimer.java
|
145
|
+
- java/src/com/rubyeventmachine/tests
|
146
|
+
- java/src/com/rubyeventmachine/tests/ApplicationTest.java
|
147
|
+
- java/src/com/rubyeventmachine/tests/ConnectTest.java
|
148
|
+
- java/src/com/rubyeventmachine/tests/EMTest.java
|
149
|
+
- java/src/com/rubyeventmachine/tests/TestDatagrams.java
|
150
|
+
- java/src/com/rubyeventmachine/tests/TestServers.java
|
151
|
+
- java/src/com/rubyeventmachine/tests/TestTimers.java
|
152
|
+
- java/src/com/rubyeventmachine/Timer.java
|
153
|
+
- tasks/cpp.rake
|
154
|
+
- tasks/project.rake
|
155
|
+
- tasks/tests.rake
|
156
|
+
- docs/ChangeLog
|
157
|
+
- docs/COPYING
|
158
|
+
- docs/DEFERRABLES
|
159
|
+
- docs/EPOLL
|
160
|
+
- docs/GNU
|
161
|
+
- docs/INSTALL
|
162
|
+
- docs/KEYBOARD
|
163
|
+
- docs/LEGAL
|
164
|
+
- docs/LIGHTWEIGHT_CONCURRENCY
|
165
|
+
- docs/PURE_RUBY
|
166
|
+
- docs/README
|
167
|
+
- docs/RELEASE_NOTES
|
168
|
+
- docs/SMTP
|
169
|
+
- docs/SPAWNED_PROCESSES
|
170
|
+
- docs/TODO
|
136
171
|
has_rdoc: true
|
137
172
|
homepage: http://rubyeventmachine.com
|
138
173
|
post_install_message:
|
@@ -140,7 +175,7 @@ rdoc_options:
|
|
140
175
|
- --title
|
141
176
|
- EventMachine
|
142
177
|
- --main
|
143
|
-
- README
|
178
|
+
- docs/README
|
144
179
|
- --line-numbers
|
145
180
|
require_paths:
|
146
181
|
- lib
|
@@ -159,9 +194,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
159
194
|
requirements: []
|
160
195
|
|
161
196
|
rubyforge_project: eventmachine
|
162
|
-
rubygems_version: 1.
|
197
|
+
rubygems_version: 1.3.1
|
163
198
|
signing_key:
|
164
199
|
specification_version: 2
|
165
200
|
summary: Ruby/EventMachine library
|
166
|
-
test_files:
|
167
|
-
|
201
|
+
test_files: []
|
202
|
+
|