Skip to content

Instantly share code, notes, and snippets.

@dakrone
Created June 22, 2009 22:16
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 dakrone/134221 to your computer and use it in GitHub Desktop.
Save dakrone/134221 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
#
# forkoff proc test
#
require 'forkoff'
require 'pp'
a = []
def foo(bar)
puts bar
end
def bar(foo)
puts foo
end
a << :foo
a << :bar
pp a
a.forkoff do |p|
self.send(p, "hiya!")
end
# Output:
# % ruby forkoff-func-test.rb
# [:foo, :bar]
# hiya!hiya!
# (hangs here forever in Ruby 1.9.1, exits fine in 1.8.6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment