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.



69
70
71
# File 'lib/rails/application/finisher.rb', line 69

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

Instance Method Details

#complete(_state) ⇒ Object



77
78
79
# File 'lib/rails/application/finisher.rb', line 77

def complete(_state)
  @mutex.unlock
end

#runObject



73
74
75
# File 'lib/rails/application/finisher.rb', line 73

def run
  @mutex.lock
end