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.



144
145
146
# File 'lib/rails/application/finisher.rb', line 144

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

Instance Method Details

#complete(_state) ⇒ Object



152
153
154
# File 'lib/rails/application/finisher.rb', line 152

def complete(_state)
  @mutex.unlock
end

#runObject



148
149
150
# File 'lib/rails/application/finisher.rb', line 148

def run
  @mutex.lock
end