Module: Runify

Defined in:
lib/runify.rb,
lib/runify/version.rb

Overview

Runify Module

Constant Summary collapse

VERSION =

Version

'0.1.1'

Instance Method Summary collapse

Instance Method Details

#restartObject

Restart Calls shutdown, immediately followed by startup



29
30
31
32
# File 'lib/runify.rb', line 29

def restart
	shutdown
	startup
end

#shutdownObject

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



21
22
23
24
25
# File 'lib/runify.rb', line 21

def shutdown
	@stop = true
	@thread.join if @thread
	@thread = nil
end

#startupObject

Startup Spawns a new Thread around the run method



13
14
15
16
17
# File 'lib/runify.rb', line 13

def startup
	return if @thread
	@stop = nil
	@thread = Thread.new { run }
end