Class: Rails::Application::Finisher::MutexHook

Inherits:
Object
  • Object
show all
Defined in:
railties/lib/rails/application/finisher.rb

Instance Method Summary collapse

Constructor Details

#initialize(mutex = Mutex.new) ⇒ MutexHook

Returns a new instance of MutexHook.


91
92
93
# File 'railties/lib/rails/application/finisher.rb', line 91

def initialize(mutex = Mutex.new)
  @mutex = mutex
end

Instance Method Details

#complete(_state) ⇒ Object


99
100
101
# File 'railties/lib/rails/application/finisher.rb', line 99

def complete(_state)
  @mutex.unlock
end

#runObject


95
96
97
# File 'railties/lib/rails/application/finisher.rb', line 95

def run
  @mutex.lock
end