starfish 1.1.3 → 1.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.
@@ -130,7 +130,7 @@
130
130
  <tr class="top-aligned-row context-row">
131
131
  <td class="context-item-name">VERSION</td>
132
132
  <td>=</td>
133
- <td class="context-item-value">&quot;1.1.3&quot;</td>
133
+ <td class="context-item-value">&quot;1.2.0&quot;</td>
134
134
  </tr>
135
135
  <tr class="top-aligned-row context-row">
136
136
  <td class="context-item-name">NULL</td>
@@ -45,11 +45,18 @@
45
45
  <span class="ruby-identifier">$server_object</span>
46
46
  <span class="ruby-keyword kw">end</span>
47
47
  <span class="ruby-keyword kw">end</span>
48
-
48
+
49
49
  <span class="ruby-identifier">map_reduce_client</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">object</span><span class="ruby-operator">|</span>
50
50
  <span class="ruby-identifier">t</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
51
- <span class="ruby-constant">Timeout</span><span class="ruby-operator">::</span><span class="ruby-identifier">timeout</span>(<span class="ruby-ivar">@@options</span>[<span class="ruby-identifier">:timeout</span>] <span class="ruby-operator">||</span> <span class="ruby-value">60</span>) <span class="ruby-keyword kw">do</span>
52
- <span class="ruby-ivar">@@client</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">object</span>)
51
+ <span class="ruby-keyword kw">begin</span>
52
+ <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@@options</span>[<span class="ruby-identifier">:timeout</span>] <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">false</span>
53
+ <span class="ruby-constant">Timeout</span><span class="ruby-operator">::</span><span class="ruby-identifier">timeout</span>(<span class="ruby-ivar">@@options</span>[<span class="ruby-identifier">:timeout</span>] <span class="ruby-operator">||</span> <span class="ruby-value">600</span>) <span class="ruby-keyword kw">do</span>
54
+ <span class="ruby-ivar">@@client</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">object</span>)
55
+ <span class="ruby-keyword kw">end</span>
56
+ <span class="ruby-keyword kw">else</span>
57
+ <span class="ruby-ivar">@@client</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">object</span>)
58
+ <span class="ruby-keyword kw">end</span>
59
+ <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Timeout</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span>
53
60
  <span class="ruby-keyword kw">end</span>
54
61
  <span class="ruby-ivar">@server_object</span>.<span class="ruby-identifier">add_time_spent_processing_objects</span>(<span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span><span class="ruby-operator">-</span><span class="ruby-identifier">t</span>)
55
62
  <span class="ruby-keyword kw">end</span>
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/starfish.rb, line 148</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/starfish.rb, line 155</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stats</span>
15
15
  <span class="ruby-identifier">negotiate</span>
16
16
  <span class="ruby-constant">Timeout</span><span class="ruby-operator">::</span><span class="ruby-identifier">timeout</span>(<span class="ruby-value">5</span>) { <span class="ruby-ivar">@server_object</span> = <span class="ruby-ivar">@ring_server</span>.<span class="ruby-identifier">read</span>([<span class="ruby-identifier">:name</span>, <span class="ruby-identifier">uniq</span>.<span class="ruby-identifier">intern</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-keyword kw">nil</span>])[<span class="ruby-value">2</span>] }
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/starfish.rb, line 157</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/starfish.rb, line 164</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sanitize</span>(<span class="ruby-identifier">object</span>)
15
15
  <span class="ruby-identifier">object</span>.<span class="ruby-identifier">extend</span> <span class="ruby-constant">DRbUndumped</span>
16
16
 
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/starfish.rb, line 179</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/starfish.rb, line 186</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">negotiate</span><span class="ruby-identifier">negotiate</span><span class="ruby-identifier">negotiate</span>
15
15
  <span class="ruby-keyword kw">begin</span>
16
16
  <span class="ruby-ivar">@ring_server</span> = <span class="ruby-constant">RingFinger</span>.<span class="ruby-identifier">primary</span>
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/starfish.rb, line 200</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/starfish.rb, line 207</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">spawn</span>
15
15
  <span class="ruby-ivar">@started</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">STARFISH_FORK</span>.<span class="ruby-identifier">call</span> { <span class="ruby-identifier">system</span>(<span class="ruby-node">&quot;ruby #{File.dirname(__FILE__)}/../bin/starfish #{@uniq} server &gt; #{NULL}&quot;</span>) }
16
16
  <span class="ruby-keyword kw">end</span></pre>
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/starfish.rb, line 204</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/starfish.rb, line 211</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stop</span>
15
15
  <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;stopping the server&quot;</span>
16
16
  <span class="ruby-constant">Process</span>.<span class="ruby-identifier">kill</span>(<span class="ruby-value str">&quot;SIGHUP&quot;</span>, <span class="ruby-constant">IO</span>.<span class="ruby-identifier">read</span>(<span class="ruby-ivar">@@options</span>[<span class="ruby-identifier">:pid</span>] <span class="ruby-operator">||</span> <span class="ruby-node">&quot;#{Dir.tmpdir}/starfish-#{uniq}.pid&quot;</span>).<span class="ruby-identifier">to_i</span>)
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/starfish.rb, line 213</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/starfish.rb, line 220</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">server=</span>(<span class="ruby-identifier">server</span>)
15
15
  <span class="ruby-ivar">@@server</span> = <span class="ruby-identifier">server</span>
16
16
  <span class="ruby-keyword kw">end</span></pre>
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/starfish.rb, line 217</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/starfish.rb, line 224</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">client=</span>(<span class="ruby-identifier">client</span>)
15
15
  <span class="ruby-ivar">@@client</span> = <span class="ruby-identifier">client</span>
16
16
  <span class="ruby-keyword kw">end</span></pre>
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/starfish.rb, line 221</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/starfish.rb, line 228</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">options=</span>(<span class="ruby-identifier">options</span>={})
15
15
  <span class="ruby-ivar">@@options</span>.<span class="ruby-identifier">update</span>(<span class="ruby-identifier">options</span>)
16
16
  <span class="ruby-keyword kw">end</span></pre>
@@ -10,7 +10,7 @@
10
10
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/starfish.rb, line 184</span>
13
+ <pre><span class="ruby-comment cmt"># File lib/starfish.rb, line 191</span>
14
14
  <span class="ruby-keyword kw">def</span> <span class="ruby-constant">RingFinger</span>.<span class="ruby-identifier">finger</span>
15
15
  <span class="ruby-ivar">@@finger</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">new</span>
16
16
  <span class="ruby-ivar">@@finger</span>.<span class="ruby-identifier">lookup_ring_any</span>
@@ -1 +1 @@
1
- Tue Sep 19 17:18:16 PDT 2006
1
+ Wed Sep 20 12:19:08 PDT 2006
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Mon Aug 28 10:10:48 PDT 2006</td>
59
+ <td>Wed Sep 20 11:53:33 PDT 2006</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Tue Sep 19 13:37:28 PDT 2006</td>
59
+ <td>Wed Sep 20 11:38:12 PDT 2006</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Tue Sep 19 17:12:29 PDT 2006</td>
59
+ <td>Wed Sep 20 12:18:39 PDT 2006</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -67,17 +67,18 @@ private
67
67
 
68
68
  def set_total
69
69
  @total = type.count(input)
70
- unless @rescan_when_complete
70
+ if @rescan_when_complete
71
+ @offset = 0
72
+ else
71
73
  @queue_size ||= @total
72
74
  end
73
75
  end
74
76
 
75
77
  def queue
76
78
  if @queue.empty?
77
- case @offset
78
- when 0
79
+ if @offset == 0
79
80
  set_total
80
- when @total
81
+ elsif @offset >= @total
81
82
  if @rescan_when_complete || @vigilant
82
83
  set_total
83
84
  else
@@ -112,7 +113,6 @@ private
112
113
  @num_queues_grabbed += 1
113
114
 
114
115
  @offset += @queue.size unless @queue.empty?
115
- @offset = 0 if @offset == @total && @rescan_when_complete
116
116
  @lock = false
117
117
  end
118
118
 
@@ -23,7 +23,7 @@ end
23
23
 
24
24
  class StarfishError < StandardError; end
25
25
  class Starfish
26
- VERSION = "1.1.3"
26
+ VERSION = "1.2.0"
27
27
  NULL = (RUBY_PLATFORM =~ /mswin/) ? 'NUL' : '/dev/null'
28
28
 
29
29
  @@server = false
@@ -110,11 +110,18 @@ class Starfish
110
110
  $server_object
111
111
  end
112
112
  end
113
-
113
+
114
114
  map_reduce_client.each do |object|
115
115
  t = Time.now
116
- Timeout::timeout(@@options[:timeout] || 60) do
117
- @@client.call(object)
116
+ begin
117
+ if @@options[:timeout] != false
118
+ Timeout::timeout(@@options[:timeout] || 600) do
119
+ @@client.call(object)
120
+ end
121
+ else
122
+ @@client.call(object)
123
+ end
124
+ rescue Timeout::Error
118
125
  end
119
126
  @server_object.add_time_spent_processing_objects(Time.now-t)
120
127
  end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: starfish
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.1.3
7
- date: 2006-09-19 00:00:00 -07:00
6
+ version: 1.2.0
7
+ date: 2006-09-20 00:00:00 -07:00
8
8
  summary: Starfish is a utility to make distributed programming ridiculously easy.
9
9
  require_paths:
10
10
  - lib