Skip to content

Instantly share code, notes, and snippets.

@mwmitchell
Created April 21, 2009 14:00
Show Gist options
  • Save mwmitchell/99154 to your computer and use it in GitHub Desktop.
Save mwmitchell/99154 to your computer and use it in GitHub Desktop.
# rails action
def in_bg
pid = fork {
10.times do |i|
puts "WAITING .... #{i}"
sleep 1.0
end
}
Process.detach(pid)
render :text=>pid.to_s
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment