eventmachine 0.12.8-x86-mswin32-60 → 0.12.10-x86-mswin32-60
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +14 -13
- data/Rakefile +374 -264
- data/eventmachine.gemspec +4 -5
- data/ext/binder.cpp +125 -126
- data/ext/binder.h +46 -48
- data/ext/cmain.cpp +184 -42
- data/ext/cplusplus.cpp +202 -202
- data/ext/ed.cpp +242 -81
- data/ext/ed.h +39 -22
- data/ext/em.cpp +127 -108
- data/ext/em.h +27 -18
- data/ext/emwin.cpp +3 -3
- data/ext/eventmachine.h +49 -38
- data/ext/eventmachine_cpp.h +96 -96
- data/ext/extconf.rb +147 -132
- data/ext/fastfilereader/extconf.rb +82 -76
- data/ext/project.h +151 -140
- data/ext/rubymain.cpp +222 -103
- data/ext/ssl.cpp +460 -460
- data/ext/ssl.h +94 -94
- data/java/src/com/rubyeventmachine/EmReactor.java +570 -423
- data/java/src/com/rubyeventmachine/EventableChannel.java +69 -57
- data/java/src/com/rubyeventmachine/EventableDatagramChannel.java +189 -171
- data/java/src/com/rubyeventmachine/EventableSocketChannel.java +364 -244
- data/java/src/com/rubyeventmachine/{Application.java → application/Application.java} +194 -200
- data/java/src/com/rubyeventmachine/{Connection.java → application/Connection.java} +74 -74
- data/java/src/com/rubyeventmachine/{ConnectionFactory.java → application/ConnectionFactory.java} +36 -36
- data/java/src/com/rubyeventmachine/{DefaultConnectionFactory.java → application/DefaultConnectionFactory.java} +46 -46
- data/java/src/com/rubyeventmachine/{PeriodicTimer.java → application/PeriodicTimer.java} +38 -38
- data/java/src/com/rubyeventmachine/{Timer.java → application/Timer.java} +54 -54
- data/java/src/com/rubyeventmachine/tests/ApplicationTest.java +109 -108
- data/java/src/com/rubyeventmachine/tests/ConnectTest.java +148 -146
- data/java/src/com/rubyeventmachine/tests/TestDatagrams.java +53 -53
- data/java/src/com/rubyeventmachine/tests/TestServers.java +75 -74
- data/java/src/com/rubyeventmachine/tests/TestTimers.java +90 -89
- data/lib/em/connection.rb +71 -12
- data/lib/em/deferrable.rb +191 -186
- data/lib/em/protocols.rb +36 -35
- data/lib/em/protocols/httpclient2.rb +590 -582
- data/lib/em/protocols/line_and_text.rb +125 -126
- data/lib/em/protocols/linetext2.rb +161 -160
- data/lib/em/protocols/object_protocol.rb +45 -39
- data/lib/em/protocols/smtpclient.rb +357 -331
- data/lib/em/protocols/socks4.rb +66 -0
- data/lib/em/queue.rb +60 -60
- data/lib/em/timers.rb +56 -55
- data/lib/em/version.rb +1 -1
- data/lib/eventmachine.rb +125 -169
- data/lib/jeventmachine.rb +257 -142
- data/tasks/{cpp.rake → cpp.rake_example} +76 -76
- data/tests/test_attach.rb +125 -100
- data/tests/test_basic.rb +1 -2
- data/tests/test_connection_count.rb +34 -44
- data/tests/test_epoll.rb +0 -2
- data/tests/test_get_sock_opt.rb +30 -0
- data/tests/test_httpclient2.rb +3 -3
- data/tests/test_inactivity_timeout.rb +21 -1
- data/tests/test_ltp.rb +182 -188
- data/tests/test_next_tick.rb +0 -2
- data/tests/test_pause.rb +70 -0
- data/tests/test_pending_connect_timeout.rb +48 -0
- data/tests/test_ssl_args.rb +78 -67
- data/tests/test_timers.rb +162 -141
- metadata +13 -11
- data/tasks/project.rake +0 -79
- data/tasks/tests.rake +0 -193
data/tests/test_next_tick.rb
CHANGED
@@ -33,7 +33,6 @@ class TestNextTick < Test::Unit::TestCase
|
|
33
33
|
|
34
34
|
def test_tick_arg
|
35
35
|
pr = proc {EM.stop}
|
36
|
-
EM.epoll
|
37
36
|
EM.run {
|
38
37
|
EM.next_tick pr
|
39
38
|
}
|
@@ -41,7 +40,6 @@ class TestNextTick < Test::Unit::TestCase
|
|
41
40
|
end
|
42
41
|
|
43
42
|
def test_tick_block
|
44
|
-
EM.epoll
|
45
43
|
EM.run {
|
46
44
|
EM.next_tick {EM.stop}
|
47
45
|
}
|
data/tests/test_pause.rb
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
$:.unshift File.expand_path(File.dirname(__FILE__) + "/../lib")
|
2
|
+
require 'eventmachine'
|
3
|
+
require 'socket'
|
4
|
+
require 'test/unit'
|
5
|
+
|
6
|
+
class TestPause < Test::Unit::TestCase
|
7
|
+
TestHost = "127.0.0.1"
|
8
|
+
TestPort = 9070
|
9
|
+
|
10
|
+
def setup
|
11
|
+
assert(!EM.reactor_running?)
|
12
|
+
end
|
13
|
+
|
14
|
+
def teardown
|
15
|
+
assert(!EM.reactor_running?)
|
16
|
+
end
|
17
|
+
|
18
|
+
#-------------------------------------
|
19
|
+
|
20
|
+
def test_pause_resume
|
21
|
+
test = self
|
22
|
+
server = nil
|
23
|
+
|
24
|
+
s_rx = c_rx = 0
|
25
|
+
|
26
|
+
EM.run do
|
27
|
+
EM.start_server TestHost, TestPort, Module.new {
|
28
|
+
define_method :post_init do
|
29
|
+
server = self
|
30
|
+
end
|
31
|
+
|
32
|
+
define_method :receive_data do |data|
|
33
|
+
s_rx += 1
|
34
|
+
|
35
|
+
EM.add_periodic_timer(0.01) { send_data 'hi' }
|
36
|
+
send_data 'hi'
|
37
|
+
|
38
|
+
# pause server, now no outgoing data will actually
|
39
|
+
# be sent and no more incoming data will be received
|
40
|
+
pause
|
41
|
+
end
|
42
|
+
}
|
43
|
+
|
44
|
+
c = EM.connect TestHost, TestPort, Module.new {
|
45
|
+
define_method :receive_data do |data|
|
46
|
+
c_rx += 1
|
47
|
+
end
|
48
|
+
}
|
49
|
+
EM.add_periodic_timer(0.01) { c.send_data 'hi' }
|
50
|
+
|
51
|
+
EM.add_timer(1) do
|
52
|
+
test.assert_equal 1, s_rx
|
53
|
+
test.assert_equal 0, c_rx
|
54
|
+
test.assert server.paused?
|
55
|
+
|
56
|
+
# resume server, queued outgoing and incoming data will be flushed
|
57
|
+
server.resume
|
58
|
+
|
59
|
+
test.assert ! server.paused?
|
60
|
+
|
61
|
+
EM.add_timer(1) do
|
62
|
+
test.assert server.paused?
|
63
|
+
test.assert s_rx >= 2
|
64
|
+
test.assert c_rx >= 1
|
65
|
+
EM.stop_event_loop
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
$:.unshift "../lib"
|
2
|
+
require 'eventmachine'
|
3
|
+
require 'test/unit'
|
4
|
+
|
5
|
+
class TestPendingConnectTimeout < Test::Unit::TestCase
|
6
|
+
|
7
|
+
def test_default
|
8
|
+
$timeout = nil
|
9
|
+
EM.run {
|
10
|
+
c = EM.connect("127.0.0.1", 54321)
|
11
|
+
$timeout = c.pending_connect_timeout
|
12
|
+
EM.stop
|
13
|
+
}
|
14
|
+
|
15
|
+
assert_equal(20.0, $timeout)
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_set_and_get
|
19
|
+
$timeout = nil
|
20
|
+
EM.run {
|
21
|
+
c = EM.connect("1.2.3.4", 54321)
|
22
|
+
c.pending_connect_timeout = 2.5
|
23
|
+
$timeout = c.pending_connect_timeout
|
24
|
+
EM.stop
|
25
|
+
}
|
26
|
+
|
27
|
+
assert_equal(2.5, $timeout)
|
28
|
+
end
|
29
|
+
|
30
|
+
module TimeoutHandler
|
31
|
+
def unbind
|
32
|
+
EM.stop
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_for_real
|
37
|
+
$timeout = nil
|
38
|
+
EM.run {
|
39
|
+
EM.heartbeat_interval = 0.1
|
40
|
+
$start = Time.now
|
41
|
+
c = EM.connect("1.2.3.4", 54321, TimeoutHandler)
|
42
|
+
c.pending_connect_timeout = 5
|
43
|
+
}
|
44
|
+
|
45
|
+
assert_in_delta(5, (Time.now - $start), 0.3)
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
data/tests/test_ssl_args.rb
CHANGED
@@ -1,68 +1,79 @@
|
|
1
|
-
require "test/unit"
|
2
|
-
require 'tempfile'
|
3
|
-
|
4
|
-
$:.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')
|
5
|
-
require "eventmachine"
|
6
|
-
|
7
|
-
module EventMachine
|
8
|
-
def self._set_mocks
|
9
|
-
class <<self
|
10
|
-
alias set_tls_parms_old set_tls_parms
|
11
|
-
alias start_tls_old start_tls
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
1
|
+
require "test/unit"
|
2
|
+
require 'tempfile'
|
3
|
+
|
4
|
+
$:.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')
|
5
|
+
require "eventmachine"
|
6
|
+
|
7
|
+
module EventMachine
|
8
|
+
def self._set_mocks
|
9
|
+
class <<self
|
10
|
+
alias set_tls_parms_old set_tls_parms
|
11
|
+
alias start_tls_old start_tls
|
12
|
+
begin
|
13
|
+
old, $VERBOSE = $VERBOSE, nil
|
14
|
+
def set_tls_parms *args; end
|
15
|
+
def start_tls *args; end
|
16
|
+
ensure
|
17
|
+
$VERBOSE = old
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def self._clear_mocks
|
23
|
+
class <<self
|
24
|
+
begin
|
25
|
+
old, $VERBOSE = $VERBOSE, nil
|
26
|
+
alias set_tls_parms set_tls_parms_old
|
27
|
+
alias start_tls start_tls_old
|
28
|
+
ensure
|
29
|
+
$VERBOSE = old
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
class TestSslArgs < Test::Unit::TestCase
|
38
|
+
def setup
|
39
|
+
EventMachine._set_mocks
|
40
|
+
end
|
41
|
+
|
42
|
+
def teardown
|
43
|
+
EventMachine._clear_mocks
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_tls_params_file_doesnt_exist
|
47
|
+
priv_file, cert_file = 'foo_priv_key', 'bar_cert_file'
|
48
|
+
[priv_file, cert_file].all? do |f|
|
49
|
+
assert(!File.exists?(f), "Cert file #{f} seems to exist, and should not for the tests")
|
50
|
+
end
|
51
|
+
|
52
|
+
# associate_callback_target is a pain! (build!)
|
53
|
+
conn = EventMachine::Connection.new('foo')
|
54
|
+
|
55
|
+
assert_raises(EventMachine::FileNotFoundException) do
|
56
|
+
conn.start_tls(:private_key_file => priv_file)
|
57
|
+
end
|
58
|
+
assert_raises(EventMachine::FileNotFoundException) do
|
59
|
+
conn.start_tls(:cert_chain_file => cert_file)
|
60
|
+
end
|
61
|
+
assert_raises(EventMachine::FileNotFoundException) do
|
62
|
+
conn.start_tls(:private_key_file => priv_file, :cert_chain_file => cert_file)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
def test_tls_params_file_does_exist
|
67
|
+
priv_file = Tempfile.new('em_test')
|
68
|
+
cert_file = Tempfile.new('em_test')
|
69
|
+
priv_file_path = priv_file.path
|
70
|
+
cert_file_path = cert_file.path
|
71
|
+
conn = EventMachine::Connection.new('foo')
|
72
|
+
params = {:private_key_file => priv_file_path, :cert_chain_file => cert_file_path}
|
73
|
+
begin
|
74
|
+
conn.start_tls params
|
75
|
+
rescue Object
|
76
|
+
assert(false, 'should not have raised an exception')
|
77
|
+
end
|
78
|
+
end
|
68
79
|
end if EM.ssl?
|
data/tests/test_timers.rb
CHANGED
@@ -1,141 +1,162 @@
|
|
1
|
-
# $Id$
|
2
|
-
#
|
3
|
-
# Author:: Francis Cianfrocca (gmail: blackhedd)
|
4
|
-
# Homepage:: http://rubyeventmachine.com
|
5
|
-
# Date:: 8 April 2006
|
6
|
-
#
|
7
|
-
# See EventMachine and EventMachine::Connection for documentation and
|
8
|
-
# usage examples.
|
9
|
-
#
|
10
|
-
#----------------------------------------------------------------------------
|
11
|
-
#
|
12
|
-
# Copyright (C) 2006-07 by Francis Cianfrocca. All Rights Reserved.
|
13
|
-
# Gmail: blackhedd
|
14
|
-
#
|
15
|
-
# This program is free software; you can redistribute it and/or modify
|
16
|
-
# it under the terms of either: 1) the GNU General Public License
|
17
|
-
# as published by the Free Software Foundation; either version 2 of the
|
18
|
-
# License, or (at your option) any later version; or 2) Ruby's License.
|
19
|
-
#
|
20
|
-
# See the file COPYING for complete licensing information.
|
21
|
-
#
|
22
|
-
#---------------------------------------------------------------------------
|
23
|
-
#
|
24
|
-
#
|
25
|
-
#
|
26
|
-
#
|
27
|
-
|
28
|
-
$:.unshift "../lib"
|
29
|
-
require 'eventmachine'
|
30
|
-
require 'test/unit'
|
31
|
-
|
32
|
-
class TestTimers < Test::Unit::TestCase
|
33
|
-
|
34
|
-
def test_timer_with_block
|
35
|
-
x = false
|
36
|
-
EventMachine.run {
|
37
|
-
EventMachine::Timer.new(0.25) {
|
38
|
-
x = true
|
39
|
-
EventMachine.stop
|
40
|
-
}
|
41
|
-
}
|
42
|
-
assert x
|
43
|
-
end
|
44
|
-
|
45
|
-
def test_timer_with_proc
|
46
|
-
x = false
|
47
|
-
EventMachine.run {
|
48
|
-
EventMachine::Timer.new(0.25, proc {
|
49
|
-
x = true
|
50
|
-
EventMachine.stop
|
51
|
-
})
|
52
|
-
}
|
53
|
-
assert x
|
54
|
-
end
|
55
|
-
|
56
|
-
def test_timer_cancel
|
57
|
-
x = true
|
58
|
-
EventMachine.run {
|
59
|
-
timer = EventMachine::Timer.new(0.25, proc { x = false })
|
60
|
-
timer.cancel
|
61
|
-
EventMachine::Timer.new(0.5, proc {EventMachine.stop})
|
62
|
-
}
|
63
|
-
assert x
|
64
|
-
end
|
65
|
-
|
66
|
-
def test_periodic_timer
|
67
|
-
x = 0
|
68
|
-
EventMachine.run {
|
69
|
-
EventMachine::PeriodicTimer.new(0.1) do
|
70
|
-
x += 1
|
71
|
-
EventMachine.stop if x == 4
|
72
|
-
end
|
73
|
-
}
|
74
|
-
assert( x == 4 )
|
75
|
-
end
|
76
|
-
|
77
|
-
def
|
78
|
-
x = 0
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
1
|
+
# $Id$
|
2
|
+
#
|
3
|
+
# Author:: Francis Cianfrocca (gmail: blackhedd)
|
4
|
+
# Homepage:: http://rubyeventmachine.com
|
5
|
+
# Date:: 8 April 2006
|
6
|
+
#
|
7
|
+
# See EventMachine and EventMachine::Connection for documentation and
|
8
|
+
# usage examples.
|
9
|
+
#
|
10
|
+
#----------------------------------------------------------------------------
|
11
|
+
#
|
12
|
+
# Copyright (C) 2006-07 by Francis Cianfrocca. All Rights Reserved.
|
13
|
+
# Gmail: blackhedd
|
14
|
+
#
|
15
|
+
# This program is free software; you can redistribute it and/or modify
|
16
|
+
# it under the terms of either: 1) the GNU General Public License
|
17
|
+
# as published by the Free Software Foundation; either version 2 of the
|
18
|
+
# License, or (at your option) any later version; or 2) Ruby's License.
|
19
|
+
#
|
20
|
+
# See the file COPYING for complete licensing information.
|
21
|
+
#
|
22
|
+
#---------------------------------------------------------------------------
|
23
|
+
#
|
24
|
+
#
|
25
|
+
#
|
26
|
+
#
|
27
|
+
|
28
|
+
$:.unshift "../lib"
|
29
|
+
require 'eventmachine'
|
30
|
+
require 'test/unit'
|
31
|
+
|
32
|
+
class TestTimers < Test::Unit::TestCase
|
33
|
+
|
34
|
+
def test_timer_with_block
|
35
|
+
x = false
|
36
|
+
EventMachine.run {
|
37
|
+
EventMachine::Timer.new(0.25) {
|
38
|
+
x = true
|
39
|
+
EventMachine.stop
|
40
|
+
}
|
41
|
+
}
|
42
|
+
assert x
|
43
|
+
end
|
44
|
+
|
45
|
+
def test_timer_with_proc
|
46
|
+
x = false
|
47
|
+
EventMachine.run {
|
48
|
+
EventMachine::Timer.new(0.25, proc {
|
49
|
+
x = true
|
50
|
+
EventMachine.stop
|
51
|
+
})
|
52
|
+
}
|
53
|
+
assert x
|
54
|
+
end
|
55
|
+
|
56
|
+
def test_timer_cancel
|
57
|
+
x = true
|
58
|
+
EventMachine.run {
|
59
|
+
timer = EventMachine::Timer.new(0.25, proc { x = false })
|
60
|
+
timer.cancel
|
61
|
+
EventMachine::Timer.new(0.5, proc {EventMachine.stop})
|
62
|
+
}
|
63
|
+
assert x
|
64
|
+
end
|
65
|
+
|
66
|
+
def test_periodic_timer
|
67
|
+
x = 0
|
68
|
+
EventMachine.run {
|
69
|
+
EventMachine::PeriodicTimer.new(0.1) do
|
70
|
+
x += 1
|
71
|
+
EventMachine.stop if x == 4
|
72
|
+
end
|
73
|
+
}
|
74
|
+
assert( x == 4 )
|
75
|
+
end
|
76
|
+
|
77
|
+
def test_add_periodic_timer
|
78
|
+
x = 0
|
79
|
+
EM.run {
|
80
|
+
t = EM.add_periodic_timer(0.1) do
|
81
|
+
x += 1
|
82
|
+
EM.stop if x == 4
|
83
|
+
end
|
84
|
+
assert t.respond_to?(:cancel)
|
85
|
+
}
|
86
|
+
end
|
87
|
+
|
88
|
+
def test_periodic_timer_cancel
|
89
|
+
x = 0
|
90
|
+
EventMachine.run {
|
91
|
+
pt = EventMachine::PeriodicTimer.new(0.25, proc { x += 1 })
|
92
|
+
pt.cancel
|
93
|
+
EventMachine::Timer.new(0.5) {EventMachine.stop}
|
94
|
+
}
|
95
|
+
assert( x == 0 )
|
96
|
+
end
|
97
|
+
|
98
|
+
def test_add_periodic_timer_cancel
|
99
|
+
x = 0
|
100
|
+
EventMachine.run {
|
101
|
+
pt = EM.add_periodic_timer(0.25) { x += 1 }
|
102
|
+
EM.cancel_timer(pt)
|
103
|
+
EM.add_timer(0.5) { EM.stop }
|
104
|
+
}
|
105
|
+
assert( x == 0 )
|
106
|
+
end
|
107
|
+
|
108
|
+
def test_periodic_timer_self_cancel
|
109
|
+
x = 0
|
110
|
+
EventMachine.run {
|
111
|
+
pt = EventMachine::PeriodicTimer.new(0.1) {
|
112
|
+
x += 1
|
113
|
+
if x == 4
|
114
|
+
pt.cancel
|
115
|
+
EventMachine.stop
|
116
|
+
end
|
117
|
+
}
|
118
|
+
}
|
119
|
+
assert( x == 4 )
|
120
|
+
end
|
121
|
+
|
122
|
+
|
123
|
+
# This test is only applicable to compiled versions of the reactor.
|
124
|
+
# Pure ruby and java versions have no built-in limit on the number of outstanding timers.
|
125
|
+
#
|
126
|
+
def test_timer_change_max_outstanding
|
127
|
+
ten_thousand_timers = proc {
|
128
|
+
10001.times {
|
129
|
+
EM.add_timer(5) {}
|
130
|
+
}
|
131
|
+
}
|
132
|
+
|
133
|
+
EM.run {
|
134
|
+
if EM.library_type == :pure_ruby
|
135
|
+
ten_thousand_timers.call
|
136
|
+
elsif EM.library_type == :java
|
137
|
+
ten_thousand_timers.call
|
138
|
+
else
|
139
|
+
begin
|
140
|
+
assert_raises( RuntimeError ) {
|
141
|
+
ten_thousand_timers.call
|
142
|
+
}
|
143
|
+
rescue Object
|
144
|
+
p $!
|
145
|
+
assert(false, $!.message)
|
146
|
+
end
|
147
|
+
end
|
148
|
+
EM.stop
|
149
|
+
}
|
150
|
+
|
151
|
+
assert(!EM.reactor_running?, 'Reactor running when it should not be.')
|
152
|
+
assert( EM.get_max_timers != 10001 )
|
153
|
+
EM.set_max_timers( 10001 )
|
154
|
+
assert( EM.get_max_timers == 10001 )
|
155
|
+
|
156
|
+
EM.run {
|
157
|
+
ten_thousand_timers.call
|
158
|
+
EM.stop
|
159
|
+
}
|
160
|
+
end
|
161
|
+
|
162
|
+
end
|