Class: Ductwork::RunningContext
- Inherits:
-
Object
- Object
- Ductwork::RunningContext
- Defined in:
- lib/ductwork/running_context.rb
Instance Method Summary collapse
-
#initialize ⇒ RunningContext
constructor
A new instance of RunningContext.
- #running? ⇒ Boolean
- #shutdown! ⇒ Object
Constructor Details
#initialize ⇒ RunningContext
Returns a new instance of RunningContext.
5 6 7 8 |
# File 'lib/ductwork/running_context.rb', line 5 def initialize @mutex = Mutex.new @running = true end |
Instance Method Details
#running? ⇒ Boolean
10 11 12 |
# File 'lib/ductwork/running_context.rb', line 10 def running? mutex.synchronize { running } end |
#shutdown! ⇒ Object
14 15 16 |
# File 'lib/ductwork/running_context.rb', line 14 def shutdown! @running = false end |