lib/ruote/log/wait_logger.rb in ruote-2.1.10 vs lib/ruote/log/wait_logger.rb in ruote-2.1.11

- old
+ new

@@ -35,36 +35,31 @@ attr_accessor :noisy def initialize (context) @context = context - @waiting = nil @color = 33 @context.worker.subscribe(:all, self) if @context.worker @noisy = false @count = -1 + + @seen = [] + @waiting = [] end def notify (msg) puts(pretty_print(msg)) if @noisy - return unless @waiting + #return if @waiting.size < 1 + #check_msg(msg) - check_msg(msg) - end + @seen << msg + @seen.shift if @seen.size > 147 - def wait_for (interests) - - @waiting = [ Thread.current, interests ] - - Thread.stop - - # and when this thread gets woken up, go on and return __result__ - - Thread.current['__result__'] + check_waiting end end end