libc-eventmachine 0.12.5.42 → 0.12.7.42

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.
@@ -3,7 +3,6 @@ require 'eventmachine'
3
3
  require 'test/unit'
4
4
 
5
5
  class TestConnectionCount < Test::Unit::TestCase
6
-
7
6
  def test_idle_connection_count
8
7
  EM.run {
9
8
  $count = EM.connection_count
@@ -13,23 +12,34 @@ class TestConnectionCount < Test::Unit::TestCase
13
12
  assert_equal(0, $count)
14
13
  end
15
14
 
15
+ module Client
16
+ def connection_completed
17
+ EM.next_tick{
18
+ $client_connected = EM.connection_count
19
+ EM.stop
20
+ }
21
+ end
22
+ end
23
+
24
+ module Server
25
+ def post_init
26
+ $server_connected = EM.connection_count
27
+ end
28
+ end
29
+
16
30
  def test_with_some_connections
17
31
  EM.run {
18
- EM.start_server("127.0.0.1", 9999)
19
- EM.connect("127.0.0.1", 9999)
20
- $first_tick = EM.connection_count
21
- EM.next_tick {
22
- $second_tick = EM.connection_count
23
- EM.next_tick {
24
- $third_tick = EM.connection_count
25
- EM.stop_event_loop
26
- }
32
+ EM.start_server("127.0.0.1", 9999, Server)
33
+ $initial = EM.connection_count
34
+ EM.next_tick{
35
+ $server_started = EM.connection_count
36
+ EM.connect("127.0.0.1", 9999, Client)
27
37
  }
28
38
  }
29
39
 
30
- assert_equal(0, $first_tick)
31
- assert_equal(2, $second_tick)
32
- assert_equal(3, $third_tick)
40
+ assert_equal(0, $initial)
41
+ assert_equal(1, $server_started)
42
+ assert_equal(2, $server_connected)
43
+ assert_equal(3, $client_connected)
33
44
  end
34
-
35
45
  end
@@ -11,12 +11,15 @@ class TestErrorHandler < Test::Unit::TestCase
11
11
  EM.stop
12
12
  }
13
13
 
14
- EM.run{
15
- EM.add_timer(0){
16
- raise 'test'
14
+ assert_nothing_raised do
15
+ EM.run{
16
+ EM.add_timer(0){
17
+ raise 'test'
18
+ }
17
19
  }
18
- }
20
+ end
19
21
 
22
+ assert_equal error.class, RuntimeError
20
23
  assert_equal error.message, 'test'
21
24
  end
22
25
 
data/tests/test_errors.rb CHANGED
@@ -42,14 +42,14 @@ class TestErrors < Test::Unit::TestCase
42
42
  def setup
43
43
  end
44
44
 
45
- def teardown
45
+ def obsolete_teardown
46
46
  # Calling #set_runtime_error_hook with no block restores the
47
47
  # default handling of runtime_errors.
48
48
  #
49
49
  EM.set_runtime_error_hook
50
50
  end
51
51
 
52
- def test_a
52
+ def test_no_tests_stub
53
53
  end
54
54
 
55
55
  # EM has a default handler for RuntimeErrors that are emitted from
@@ -52,5 +52,44 @@ class TestProcesses < Test::Unit::TestCase
52
52
  assert( ls.length > 0)
53
53
  end
54
54
 
55
+ def setup
56
+ $out = nil
57
+ $status = nil
58
+ end
59
+
60
+ def test_em_system
61
+ EM.run{
62
+ EM.system('ls'){ |out,status| $out, $status = out, status; EM.stop }
63
+ }
64
+
65
+ assert( $out.length > 0 )
66
+ assert_equal($status.exitstatus, 0)
67
+ assert_equal($status.class, Process::Status)
68
+ end
69
+
70
+ def test_em_system_with_proc
71
+ EM.run{
72
+ EM.system('ls', proc{ |out,status| $out, $status = out, status; EM.stop })
73
+ }
74
+
75
+ assert( $out.length > 0 )
76
+ assert_equal($status.exitstatus, 0)
77
+ assert_equal($status.class, Process::Status)
78
+ end
79
+
80
+ def test_em_system_with_two_procs
81
+ EM.run{
82
+ EM.system('sh', proc{ |process|
83
+ process.send_data("echo hello\n")
84
+ process.send_data("exit\n")
85
+ }, proc{ |out,status|
86
+ $out = out
87
+ $status = status
88
+ EM.stop
89
+ })
90
+ }
91
+
92
+ assert_equal($out, "hello\n")
93
+ end
55
94
  end
56
95
 
data/web/whatis ADDED
@@ -0,0 +1,7 @@
1
+ EventMachine is a library for Ruby, C++, and Java programs. It provides event-driven I/O using the Reactor pattern.
2
+
3
+ EventMachine is designed to simultaneously meet two key needs:
4
+ - Extremely high scalability, performance and stability for the most demanding production environments; and
5
+ - An API that <i>eliminates</i> the complexities of high-performance threaded network programming, allowing engineers to concentrate on their application logic.
6
+
7
+ This unique combination makes EventMachine a premier choice for designers of critical networked applications, including web servers and proxies, email and IM production systems, authentication/authorization processors, and many more.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libc-eventmachine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.5.42
4
+ version: 0.12.7.42
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francis Cianfrocca
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-03-01 00:00:00 -08:00
12
+ date: 2009-03-10 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -37,129 +37,58 @@ extra_rdoc_files:
37
37
  - docs/SPAWNED_PROCESSES
38
38
  - docs/TODO
39
39
  files:
40
+ - .gitignore
41
+ - README
40
42
  - Rakefile
41
- - tests/test_attach.rb
42
- - tests/test_basic.rb
43
- - tests/test_bind.rb
44
- - tests/test_connection_count.rb
45
- - tests/test_defer.rb
46
- - tests/test_epoll.rb
47
- - tests/test_error_handler.rb
48
- - tests/test_errors.rb
49
- - tests/test_eventables.rb
50
- - tests/test_exc.rb
51
- - tests/test_futures.rb
52
- - tests/test_handler_check.rb
53
- - tests/test_hc.rb
54
- - tests/test_httpclient.rb
55
- - tests/test_httpclient2.rb
56
- - tests/test_kb.rb
57
- - tests/test_ltp.rb
58
- - tests/test_ltp2.rb
59
- - tests/test_next_tick.rb
60
- - tests/test_processes.rb
61
- - tests/test_pure.rb
62
- - tests/test_running.rb
63
- - tests/test_sasl.rb
64
- - tests/test_send_file.rb
65
- - tests/test_servers.rb
66
- - tests/test_smtpclient.rb
67
- - tests/test_smtpserver.rb
68
- - tests/test_spawn.rb
69
- - tests/test_ssl_args.rb
70
- - tests/test_ssl_methods.rb
71
- - tests/test_timers.rb
72
- - tests/test_ud.rb
73
- - tests/testem.rb
74
- - lib/em
75
- - lib/em/deferrable.rb
76
- - lib/em/eventable.rb
77
- - lib/em/future.rb
78
- - lib/em/messages.rb
79
- - lib/em/processes.rb
80
- - lib/em/spawnable.rb
81
- - lib/em/streamer.rb
82
- - lib/eventmachine.rb
83
- - lib/eventmachine_version.rb
84
- - lib/evma
85
- - lib/evma/callback.rb
86
- - lib/evma/container.rb
87
- - lib/evma/factory.rb
88
- - lib/evma/protocol.rb
89
- - lib/evma/reactor.rb
90
- - lib/evma.rb
91
- - lib/fastfilereaderext.bundle
92
- - lib/jeventmachine.rb
93
- - lib/pr_eventmachine.rb
94
- - lib/protocols
95
- - lib/protocols/buftok.rb
96
- - lib/protocols/header_and_content.rb
97
- - lib/protocols/httpcli2.rb
98
- - lib/protocols/httpclient.rb
99
- - lib/protocols/line_and_text.rb
100
- - lib/protocols/linetext2.rb
101
- - lib/protocols/memcache.rb
102
- - lib/protocols/postgres.rb
103
- - lib/protocols/saslauth.rb
104
- - lib/protocols/smtpclient.rb
105
- - lib/protocols/smtpserver.rb
106
- - lib/protocols/stomp.rb
107
- - lib/protocols/tcptest.rb
108
- - lib/rubyeventmachine.bundle
109
- - ext/Makefile
43
+ - docs/COPYING
44
+ - docs/ChangeLog
45
+ - docs/DEFERRABLES
46
+ - docs/EPOLL
47
+ - docs/GNU
48
+ - docs/INSTALL
49
+ - docs/KEYBOARD
50
+ - docs/LEGAL
51
+ - docs/LIGHTWEIGHT_CONCURRENCY
52
+ - docs/PURE_RUBY
53
+ - docs/README
54
+ - docs/RELEASE_NOTES
55
+ - docs/SMTP
56
+ - docs/SPAWNED_PROCESSES
57
+ - docs/TODO
58
+ - eventmachine.gemspec
110
59
  - ext/binder.cpp
111
60
  - ext/binder.h
112
- - ext/binder.o
113
61
  - ext/cmain.cpp
114
- - ext/cmain.o
115
62
  - ext/cplusplus.cpp
116
- - ext/cplusplus.o
117
63
  - ext/ed.cpp
118
64
  - ext/ed.h
119
- - ext/ed.o
120
65
  - ext/em.cpp
121
66
  - ext/em.h
122
- - ext/em.o
123
67
  - ext/emwin.cpp
124
68
  - ext/emwin.h
125
- - ext/emwin.o
126
69
  - ext/epoll.cpp
127
70
  - ext/epoll.h
128
- - ext/epoll.o
129
71
  - ext/eventmachine.h
130
72
  - ext/eventmachine_cpp.h
131
73
  - ext/extconf.rb
132
- - ext/fastfilereader
133
- - ext/fastfilereader/Makefile
134
74
  - ext/fastfilereader/extconf.rb
135
75
  - ext/fastfilereader/mapper.cpp
136
76
  - ext/fastfilereader/mapper.h
137
- - ext/fastfilereader/mapper.o
138
77
  - ext/fastfilereader/rubymain.cpp
139
- - ext/fastfilereader/rubymain.o
140
78
  - ext/files.cpp
141
79
  - ext/files.h
142
- - ext/files.o
143
80
  - ext/kb.cpp
144
- - ext/kb.o
145
- - ext/mkmf.log
146
81
  - ext/page.cpp
147
82
  - ext/page.h
148
- - ext/page.o
149
83
  - ext/pipe.cpp
150
- - ext/pipe.o
151
84
  - ext/project.h
152
85
  - ext/rubymain.cpp
153
- - ext/rubymain.o
154
86
  - ext/sigs.cpp
155
87
  - ext/sigs.h
156
- - ext/sigs.o
157
88
  - ext/ssl.cpp
158
89
  - ext/ssl.h
159
- - ext/ssl.o
160
- - java/src
161
- - java/src/com
162
- - java/src/com/rubyeventmachine
90
+ - java/.classpath
91
+ - java/.project
163
92
  - java/src/com/rubyeventmachine/Application.java
164
93
  - java/src/com/rubyeventmachine/Connection.java
165
94
  - java/src/com/rubyeventmachine/ConnectionFactory.java
@@ -171,31 +100,80 @@ files:
171
100
  - java/src/com/rubyeventmachine/EventableSocketChannel.java
172
101
  - java/src/com/rubyeventmachine/PeriodicTimer.java
173
102
  - java/src/com/rubyeventmachine/Timer.java
174
- - java/src/com/rubyeventmachine/tests
175
103
  - java/src/com/rubyeventmachine/tests/ApplicationTest.java
176
104
  - java/src/com/rubyeventmachine/tests/ConnectTest.java
177
105
  - java/src/com/rubyeventmachine/tests/EMTest.java
178
106
  - java/src/com/rubyeventmachine/tests/TestDatagrams.java
179
107
  - java/src/com/rubyeventmachine/tests/TestServers.java
180
108
  - java/src/com/rubyeventmachine/tests/TestTimers.java
109
+ - lib/em/deferrable.rb
110
+ - lib/em/eventable.rb
111
+ - lib/em/future.rb
112
+ - lib/em/messages.rb
113
+ - lib/em/processes.rb
114
+ - lib/em/spawnable.rb
115
+ - lib/em/streamer.rb
116
+ - lib/eventmachine.rb
117
+ - lib/eventmachine_version.rb
118
+ - lib/evma.rb
119
+ - lib/evma/callback.rb
120
+ - lib/evma/container.rb
121
+ - lib/evma/factory.rb
122
+ - lib/evma/protocol.rb
123
+ - lib/evma/reactor.rb
124
+ - lib/jeventmachine.rb
125
+ - lib/pr_eventmachine.rb
126
+ - lib/protocols/buftok.rb
127
+ - lib/protocols/header_and_content.rb
128
+ - lib/protocols/httpcli2.rb
129
+ - lib/protocols/httpclient.rb
130
+ - lib/protocols/line_and_text.rb
131
+ - lib/protocols/linetext2.rb
132
+ - lib/protocols/memcache.rb
133
+ - lib/protocols/postgres.rb
134
+ - lib/protocols/saslauth.rb
135
+ - lib/protocols/smtpclient.rb
136
+ - lib/protocols/smtpserver.rb
137
+ - lib/protocols/stomp.rb
138
+ - lib/protocols/tcptest.rb
139
+ - setup.rb
181
140
  - tasks/cpp.rake
182
141
  - tasks/project.rake
183
142
  - tasks/tests.rake
184
- - docs/COPYING
185
- - docs/ChangeLog
186
- - docs/DEFERRABLES
187
- - docs/EPOLL
188
- - docs/GNU
189
- - docs/INSTALL
190
- - docs/KEYBOARD
191
- - docs/LEGAL
192
- - docs/LIGHTWEIGHT_CONCURRENCY
193
- - docs/PURE_RUBY
194
- - docs/README
195
- - docs/RELEASE_NOTES
196
- - docs/SMTP
197
- - docs/SPAWNED_PROCESSES
198
- - docs/TODO
143
+ - tests/test_attach.rb
144
+ - tests/test_basic.rb
145
+ - tests/test_bind.rb
146
+ - tests/test_connection_count.rb
147
+ - tests/test_defer.rb
148
+ - tests/test_epoll.rb
149
+ - tests/test_error_handler.rb
150
+ - tests/test_errors.rb
151
+ - tests/test_eventables.rb
152
+ - tests/test_exc.rb
153
+ - tests/test_futures.rb
154
+ - tests/test_handler_check.rb
155
+ - tests/test_hc.rb
156
+ - tests/test_httpclient.rb
157
+ - tests/test_httpclient2.rb
158
+ - tests/test_kb.rb
159
+ - tests/test_ltp.rb
160
+ - tests/test_ltp2.rb
161
+ - tests/test_next_tick.rb
162
+ - tests/test_processes.rb
163
+ - tests/test_pure.rb
164
+ - tests/test_running.rb
165
+ - tests/test_sasl.rb
166
+ - tests/test_send_file.rb
167
+ - tests/test_servers.rb
168
+ - tests/test_smtpclient.rb
169
+ - tests/test_smtpserver.rb
170
+ - tests/test_spawn.rb
171
+ - tests/test_ssl_args.rb
172
+ - tests/test_ssl_methods.rb
173
+ - tests/test_timers.rb
174
+ - tests/test_ud.rb
175
+ - tests/testem.rb
176
+ - web/whatis
199
177
  has_rdoc: true
200
178
  homepage: http://rubyeventmachine.com
201
179
  post_install_message: