module Runify

Runify Module: Root Module for Runify.

Runify Module

Constants

VERSION

Version

Public Instance Methods

restart() click to toggle source

Restart: Calls shutdown, immediately followed by startup.

# File lib/runify.rb, line 32
def restart
        shutdown
        startup
end
shutdown() click to toggle source

Shutdown: Requests the run method to complete and blocks until it returns.

# File lib/runify.rb, line 24
def shutdown
        @stop = true
        @thread.join if defined?(@thread) && @thread
        @thread = nil
end
startup() click to toggle source

Startup: Spawns a new Thread around the run method.

# File lib/runify.rb, line 16
def startup
        return if defined?(@thread) && @thread
        @stop = nil
        @thread = Thread.new { run }
end