evdispatch 0.1.5 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +9 -6
- data/ext/revdispatch/libdispatch-0.1/Changelog +11 -0
- data/ext/revdispatch/libdispatch-0.1/Makefile.in +61 -76
- data/ext/revdispatch/libdispatch-0.1/aclocal.m4 +260 -463
- data/ext/revdispatch/libdispatch-0.1/configure +3953 -4668
- data/ext/revdispatch/libdispatch-0.1/src/Makefile.in +59 -73
- data/ext/revdispatch/libdispatch-0.1/src/ev_dispatch.cc +35 -0
- data/ext/revdispatch/libdispatch-0.1/src/ev_dispatch.h +16 -20
- data/ext/revdispatch/libdispatch-0.1/src/ev_http.cc +104 -23
- data/ext/revdispatch/libdispatch-0.1/src/ev_http.h +21 -7
- data/ext/revdispatch/libdispatch-0.1/test/Makefile.am +6 -1
- data/ext/revdispatch/libdispatch-0.1/test/Makefile.in +98 -93
- data/ext/revdispatch/libdispatch-0.1/test/next_test.cc +8 -6
- data/ext/revdispatch/revdispatch.cc +51 -5
- data/ext/revdispatch/server.rb +13 -2
- data/ext/revdispatch/test.rb +1 -0
- data/lib/evdispatch/version.rb +2 -2
- data/test/test_evdispatch.rb +16 -8
- data/website/index.html +2 -2
- data/website/index.txt +1 -2
- metadata +2 -2
data/test/test_evdispatch.rb
CHANGED
@@ -2,13 +2,21 @@ require File.dirname(__FILE__) + '/test_helper.rb'
|
|
2
2
|
|
3
3
|
class TestEvdispatch < Test::Unit::TestCase
|
4
4
|
|
5
|
+
def is_linux?
|
6
|
+
!(`uname`.grep(/linux/i)).empty?
|
7
|
+
end
|
8
|
+
|
5
9
|
def test_object_test
|
6
10
|
# start up the test server
|
7
|
-
|
8
|
-
|
9
|
-
|
11
|
+
if is_linux?
|
12
|
+
pid = fork do
|
13
|
+
require File.dirname(__FILE__) + '/../ext/revdispatch/server'
|
14
|
+
start_test_server
|
15
|
+
end
|
16
|
+
sleep 1
|
17
|
+
else
|
18
|
+
STDERR.puts "make sure '#{File.dirname(__FILE__) + '/../ext/revdispatch/server'} start' is running..."
|
10
19
|
end
|
11
|
-
sleep 1 unless ARGV[0] == 'r'
|
12
20
|
|
13
21
|
d = Evdispatch::Loop.new
|
14
22
|
|
@@ -22,14 +30,14 @@ class TestEvdispatch < Test::Unit::TestCase
|
|
22
30
|
10.times do
|
23
31
|
begin
|
24
32
|
start_count = ObjectSpace.each_object { }
|
25
|
-
duration = run_trial(d,
|
33
|
+
duration = run_trial(d, 100)
|
26
34
|
new_count = ObjectSpace.each_object { }
|
27
35
|
puts "10 trials: #{duration} seconds, new objects #{new_count - start_count}, #{new_count} - #{start_count}"
|
28
36
|
end
|
29
37
|
|
30
38
|
begin
|
31
39
|
start_count = ObjectSpace.each_object { }
|
32
|
-
duration = run_trial(d,
|
40
|
+
duration = run_trial(d, 200)
|
33
41
|
new_count = ObjectSpace.each_object { }
|
34
42
|
puts "100 trials: #{duration} seconds, new objects #{new_count - start_count}, #{new_count} - #{start_count}"
|
35
43
|
end
|
@@ -50,7 +58,7 @@ class TestEvdispatch < Test::Unit::TestCase
|
|
50
58
|
# sometime later you can stop the event loop
|
51
59
|
d.stop
|
52
60
|
ensure
|
53
|
-
Process.kill('HUP', pid)
|
61
|
+
Process.kill('HUP', pid) if is_linux?
|
54
62
|
end
|
55
63
|
|
56
64
|
def request_bytes_from( d, base, amount, range )
|
@@ -76,7 +84,7 @@ class TestEvdispatch < Test::Unit::TestCase
|
|
76
84
|
ebbbase = "http://127.0.0.1:4044/"
|
77
85
|
timer = Time.now
|
78
86
|
ids = request_bytes_from( d, ebbbase, trials, 1000 )
|
79
|
-
ids += request_delay_from( d, ebbbase, trials, 1 )
|
87
|
+
#ids += request_delay_from( d, ebbbase, trials, 1 )
|
80
88
|
|
81
89
|
# wait for each response
|
82
90
|
puts "expecting #{ids.size} responses..."
|
data/website/index.html
CHANGED
@@ -18,7 +18,7 @@
|
|
18
18
|
<h1>evdispatch</h1>
|
19
19
|
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/evdispatch"; return false'>
|
20
20
|
<p>Get Version</p>
|
21
|
-
<a href="http://rubyforge.org/projects/evdispatch" class="numbers">0.1.
|
21
|
+
<a href="http://rubyforge.org/projects/evdispatch" class="numbers">0.1.5</a>
|
22
22
|
</div>
|
23
23
|
<h4 style="float:right;padding-right:10px;">→ ‘evdispatch’</h4>
|
24
24
|
|
@@ -46,7 +46,7 @@ in ruby by monitoring a file handle, making it possible to use IO.select.</p>
|
|
46
46
|
|
47
47
|
|
48
48
|
<p>The intended use of this library was to provide a method for
|
49
|
-
web applications to make multiple concurrent to satisify a single request.</p>
|
49
|
+
web applications to make multiple concurrent service requests to satisify a single web request.</p>
|
50
50
|
|
51
51
|
|
52
52
|
<p>For example in rails this might look like:</p>
|
data/website/index.txt
CHANGED
@@ -23,8 +23,7 @@ in ruby by monitoring a file handle, making it possible to use IO.select.
|
|
23
23
|
|
24
24
|
|
25
25
|
The intended use of this library was to provide a method for
|
26
|
-
web applications to make multiple concurrent to satisify a single request.
|
27
|
-
|
26
|
+
web applications to make multiple concurrent service requests to satisify a single web request.
|
28
27
|
|
29
28
|
For example in rails this might look like:
|
30
29
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: evdispatch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Todd A. Fisher
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-04-
|
12
|
+
date: 2008-04-13 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|