[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    Re: select([]) method
From:       Ari Brown <ari () aribrown ! com>
Date:       2007-05-31 19:58:23
Message-ID: 8CC31695-A727-441E-A052-43049B12F32E () aribrown ! com
[Download RAW message or body]


On May 31, 2007, at 10:12 AM, Felipe Contreras wrote:

> On 5/31/07, Ari Brown <ari@aribrown.com> wrote:
>> Hey all
>>         I cam across a new method:
>> select([], [], [], [])
>> where the objects in the select parentheses are arrays.
>>
>> But what does this exactly do? I could not find ANY documentation on
>> it. The original code is:
>>
>> ready = select([@irc, $stdin], nil, nil, nil)
>
> I agree with other comments, the documentation for select is pretty  
> bad.
>
> The most simple way to use it is like this:
>
> svrs = IO.select([my_fd], nil, nil, 0)
> svrs[0].each { |io| puts io.readline }

Alright, thanks everyone! This really cleared it up, and now i  
learned like 800 new things about ruby. BTW, the link that was tossed  
was definitely a great link. Thanks!

ari
--------------------------------------------|
If you're not living on the edge,
then you're just wasting space.



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic