opee 1.0.2 → 1.0.3

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.
data/README.md CHANGED
@@ -24,9 +24,11 @@ Give it a try. Any comments, thoughts, or suggestions are welcome.
24
24
 
25
25
  ## <a name="release">Release Notes</a>
26
26
 
27
- ### Release 1.0.2
27
+ ### Release 1.0.3
28
28
 
29
- - Added AskQueue which serves up method invocations instead of jobs.
29
+ - Added periodic status output to info mode.
30
+
31
+ - Set logger name.
30
32
 
31
33
  # Plans and Notes
32
34
 
@@ -206,10 +206,18 @@ module Opee
206
206
  # Waits for all Actors to complete processing. The method only returns
207
207
  # when all Actors indicate they are no longer busy.
208
208
  def self.wait_finish()
209
+ next_time = Time.now + 2.0
209
210
  @@finish_thread = Thread.current
210
211
  @@actors.each { |a| a.wakeup() }
211
212
  while busy?
212
213
  sleep(0.2) # actors should wake up when queue is empty
214
+ if Logger::INFO >= @@log.severity
215
+ now = Time.now
216
+ if next_time <= now
217
+ log_status()
218
+ next_time = now + 2.0
219
+ end
220
+ end
213
221
  end
214
222
  end
215
223
 
@@ -234,5 +242,11 @@ module Opee
234
242
  end
235
243
  end
236
244
 
245
+ def self.log_status()
246
+ s = "\n %20s %5s %5s\n" % ['Actor Name', 'Q-cnt', 'busy?']
247
+ @@actors.each { |a| s << " %20s %5d %5s\n" % [a.name, a.queue_count(), a.busy?()] }
248
+ info(s)
249
+ end
250
+
237
251
  end # Env
238
252
  end # Opee
@@ -58,6 +58,7 @@ module Opee
58
58
  @logger.severity = options[:severity] if options.has_key?(:severity)
59
59
  @formatter = options.fetch(:formatter, nil)
60
60
  @logger.formatter = proc { |s,t,p,m| m }
61
+ @name = 'Logger' if @name.nil?
61
62
  end
62
63
 
63
64
  # Writes a message if the severity is high enough. This method is
@@ -79,7 +79,7 @@ module Opee
79
79
 
80
80
  # Identifies a worker as available to process jobs when they become
81
81
  # available. This method is executed asynchronously.
82
- # @param [Actor] worker Actor that responds to the {#method}
82
+ # @param [Actor] worker Actor that responds to the method to be called
83
83
  def ready(worker)
84
84
  if @work_queue.empty?
85
85
  @workers.insert(0, worker) unless @workers.include?(worker)
@@ -1,5 +1,5 @@
1
1
 
2
2
  module Opee
3
3
  # Current version of the module.
4
- VERSION = '1.0.2'
4
+ VERSION = '1.0.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opee
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-29 00:00:00.000000000 Z
12
+ date: 2012-06-12 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: ! 'An experimental Object-base Parallel Evaluation Environment. '
15
15
  email: peter@ohler.com