Created
June 22, 2009 22:16
-
-
Save dakrone/134221 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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