Module: Runify
- Defined in:
- lib/runify.rb,
lib/runify/version.rb
Overview
Runify Module
Constant Summary collapse
- VERSION =
Version
'0.1.0'
Instance Method Summary collapse
-
#restart ⇒ Object
Restart Calls shutdown, immediately followed by startup.
-
#shutdown ⇒ Object
Shutdown Requests the run method to complete and blocks until it returns.
-
#startup ⇒ Object
Startup Spawns a new Thread around the run method.
Instance Method Details
#restart ⇒ Object
Restart Calls shutdown, immediately followed by startup
29 30 31 32 |
# File 'lib/runify.rb', line 29 def restart shutdown startup end |
#shutdown ⇒ Object
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 |
#startup ⇒ Object
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 |