Module: Moped::Executable
- Included in:
- Node
- Defined in:
- lib/moped/executable.rb
Overview
Provides common behavior around executing a thread local stack safely.
Instance Method Summary collapse
-
#execute(name) ⇒ Object
Given the name of a thread local stack, ensure that execution happens by starting and ending the stack execution cleanly.
-
#executing?(name) ⇒ true, false
Are we currently executing a stack on the thread?.
Instance Method Details
#execute(name) ⇒ Object
Given the name of a thread local stack, ensure that execution happens by starting and ending the stack execution cleanly.
22 23 24 25 26 27 28 29 |
# File 'lib/moped/executable.rb', line 22 def execute(name) begin_execution(name) begin yield(self) ensure end_execution(name) end end |
#executing?(name) ⇒ true, false
Are we currently executing a stack on the thread?
41 42 43 |
# File 'lib/moped/executable.rb', line 41 def executing?(name) !stack(name).empty? end |