これはひどい
http://www.ruby-lang.org/ja/man/index.cgi?cmd=view;name=IO;em=select

IO.select(reads[, writes[, excepts[, timeout]]])
select(2) を実行します。