evdispatch 0.1.5 → 0.2.0

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.
@@ -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
- pid = fork do
8
- require File.dirname(__FILE__) + '/../ext/revdispatch/server'
9
- start_test_server
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, 10)
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, 100)
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) unless ARGV[0] == 'r'
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.3</a>
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;">&#x2192; &#8216;evdispatch&#8217;</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.1.5
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 00:00:00 -04:00
12
+ date: 2008-04-13 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies: []
15
15