Class: Rails::Application::Finisher::MutexHook
- Inherits:
-
Object
- Object
- Rails::Application::Finisher::MutexHook
- Defined in:
- lib/rails/application/finisher.rb
Instance Method Summary collapse
- #complete(_state) ⇒ Object
-
#initialize(mutex = Mutex.new) ⇒ MutexHook
constructor
A new instance of MutexHook.
- #run ⇒ Object
Constructor Details
#initialize(mutex = Mutex.new) ⇒ MutexHook
Returns a new instance of MutexHook.
89 90 91 |
# File 'lib/rails/application/finisher.rb', line 89 def initialize(mutex = Mutex.new) @mutex = mutex end |
Instance Method Details
#complete(_state) ⇒ Object
97 98 99 |
# File 'lib/rails/application/finisher.rb', line 97 def complete(_state) @mutex.unlock end |
#run ⇒ Object
93 94 95 |
# File 'lib/rails/application/finisher.rb', line 93 def run @mutex.lock end |