Method: Vagrant::Util::Busy.busy

Defined in:
lib/vagrant/util/busy.rb

.busy(sig_callback) ⇒ Object

Mark a given block of code as a "busy" block of code, which will register a SIGINT handler for the duration of the block. When a SIGINT occurs, the sig_callback proc will be called. It is up to the callback to behave properly and exit the application.



17
18
19
20
21
22
# File 'lib/vagrant/util/busy.rb', line 17

def busy(sig_callback)
  register(sig_callback)
  yield
ensure
  unregister(sig_callback)
end