Sha256: 392b7964d49128e458f59c529315f4bce3dd158eda62caaef7c073277805f358

Contents?: true

Size: 421 Bytes

Versions: 14

Compression:

Stored size: 421 Bytes

Contents

module RevealCK
  module Commands
    # Utility that wakes up a thread periodically
    class ThreadWaker
      def initialize(thread_to_wake, wait_period = 1)
        @thread_to_wake = thread_to_wake
        @wait_period = wait_period
      end

      def run
        Thread.new do
          loop do
            sleep @wait_period
            @thread_to_wake.wakeup
          end
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
reveal-ck-3.9.2 lib/reveal-ck/commands/thread_waker.rb
reveal-ck-3.9.1 lib/reveal-ck/commands/thread_waker.rb
reveal-ck-3.9.0 lib/reveal-ck/commands/thread_waker.rb
reveal-ck-3.8.1 lib/reveal-ck/commands/thread_waker.rb
reveal-ck-3.8.0 lib/reveal-ck/commands/thread_waker.rb
reveal-ck-3.7.0 lib/reveal-ck/commands/thread_waker.rb
reveal-ck-3.6.0 lib/reveal-ck/commands/thread_waker.rb
reveal-ck-3.5.1 lib/reveal-ck/commands/thread_waker.rb
reveal-ck-3.5.0 lib/reveal-ck/commands/thread_waker.rb
reveal-ck-3.4.0 lib/reveal-ck/commands/thread_waker.rb
reveal-ck-3.3.1 lib/reveal-ck/commands/thread_waker.rb
reveal-ck-3.3.0 lib/reveal-ck/commands/thread_waker.rb
reveal-ck-3.2.0 lib/reveal-ck/commands/thread_waker.rb
reveal-ck-3.1.0 lib/reveal-ck/commands/thread_waker.rb