Skip to content

Instantly share code, notes, and snippets.

@gabrtv
Last active December 30, 2015 12:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gabrtv/7830923 to your computer and use it in GitHub Desktop.
Save gabrtv/7830923 to your computer and use it in GitHub Desktop.
ruby_block "stop-services-in-parallel" do
block do
threads = []
targets.each { |s, f|
threads << Thread.new { |t|
s.run_action(:stop)
f.run_action(:delete)
}
}
threads.each { |t| t.join }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment