Skip to content

Instantly share code, notes, and snippets.

@jballanc
Created October 23, 2011 02:33
Show Gist options
  • Save jballanc/1306773 to your computer and use it in GitHub Desktop.
Save jballanc/1306773 to your computer and use it in GitHub Desktop.
#!/usr/local/bin/macruby
server = Dispatch::Queue.new('my-server')
in_progress = Dispatch::Group.new
server.async(in_progress) do
puts "Server running"
server.suspend!
puts "Queueing up remaining server process for later"
server.async(in_progress) do
puts "Server running again"
end
puts "Press return to continue the server"
gets
server.resume!
end
in_progress.wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment