classMyClassincludeAsync::Basedefsay_helloputs"hello"endendobj=MyClass.new# Run #say_hello synchronouslyobj.say_hello=>nil# Run #say_hello asynchronouslyobj.async(&:say_hello)=>#<Thread:0x007fea3c8f5858 run>
26
27
28
# File 'lib/async/base.rb', line 26defasyncThread.new{instance_eval&Proc.new}end