How do I do something like this :
i = 0
a = Thread.new {
i.valueChange { | val | puts "i is now #{val} }
}
b = Thread.new {
i = 2 # => "i is now 2"
}
a.join
b.join
The idea is everytime the value of i changes, the block associated
with i gets executed
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---