Cannot find in documentation anymore what tl is in

X

Xeno Campanoli

begin
Timeout::timeout(OverallTimeout) do |tl|
# Until I find out what this is, Forget it...
# No doc on tl anymore!
#puts "tl: #{tl}"
probe_threads.each { |t| t.join }
puts "done"
end
rescue Timeout::Error => eo
puts "#{eo.message}, exiting before joining all probe threads."
end

Can anyone help? Is it deprecated perhaps?
 
H

Heesob Park

2009/6/30 Xeno Campanoli said:
=C2=A0begin
=C2=A0 =C2=A0 =C2=A0 =C2=A0Timeout::timeout(OverallTimeout) do |tl|
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# Until I find out what this is,= Forget it...
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# No doc on tl anymore!
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0#puts "tl: =C2=A0#{tl}"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0probe_threads.each { |t| =C2=A0t= join }
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0puts "done"
=C2=A0 =C2=A0 =C2=A0 =C2=A0end
=C2=A0 =C2=A0rescue Timeout::Error =3D> eo
=C2=A0 =C2=A0 =C2=A0 =C2=A0puts "#{eo.message}, exiting before joining al= l probe threads."
=C2=A0 =C2=A0end

Can anyone help? =C2=A0Is it deprecated perhaps?
According to the document[1], tl is same to OverallTimeout.

BTW, I noticed the 1.8.6 document[2] is wrong in block parameter.
timeout(sec, exception=3DError) {|if sec =3D=3D nil or sec.zero?| ...}

I guess it is related to the bug in the source code of 1.8.6 and 1.8.7
The first line of method timeout
return yield if sec =3D=3D nil or sec.zero?
should be
return yield(sec) if sec =3D=3D nil or sec.zero?

[1] http://ruby-doc.org/core-1.9/classes/Timeout.html#M006441
[2] http://ruby-doc.org/stdlib/libdoc/timeout/rdoc/classes/Timeout.html#M00=
4621

Regards,

Park Heesob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top