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

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

Instance Method Summary collapse

Constructor Details

#initialize(mutex = Mutex.new) ⇒ MutexHook

Returns a new instance of MutexHook.



133
134
135
# File 'lib/rails/application/finisher.rb', line 133

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

Instance Method Details

#complete(_state) ⇒ Object



141
142
143
# File 'lib/rails/application/finisher.rb', line 141

def complete(_state)
  @mutex.unlock
end

#runObject



137
138
139
# File 'lib/rails/application/finisher.rb', line 137

def run
  @mutex.lock
end