From: Michael Granger Date: 2002-04-20T00:00:45+09:00 Subject: Re: [ANN] Ruby-Poll-0.01 Jean-Hugues ROBERT (in "Re: [ANN] Ruby-Poll-0.01") wrote: > Two questions. > A) What are the advantages of poll() over select() and is there a > similar OO encapsulation of select available (i.e. a Pure ruby one). I'm no expert, so take this for what it's worth. I personally prefer poll() because I find its interface to be much cleaner, and, under certain cases, more efficient. The things I like, in particular: 1. It allows one to specify the sorts of things one is interested in with a much finer granularity. For example, out-of-band data is distinguishable from an exception. 2. It only requires that one maintain one array (or Hash in the case of Ruby-Poll), rather than select()'s three. It also doesn't require you to initialize the data structures each time, though I'm not taking advantage of that in this particular implementation. 3. It's more efficient for small numbers of descriptors. I don't know of an encapsulation of select() like Ruby-Poll's. That, of course, doesn't mean there isn't one. Also, Ruby-Poll's implementation isn't pure Ruby, though I'm not sure that's what you meant. >> [...] when I click on new(), the source appears inline, colored; >> really nice. > B) Unfortunately this seems not to work with my Opera browser. Another > Javascript implementation issue I guess. Probably. I don't have access to Opera, so I can't test this for myself. It seems to work okay in Mozilla and IE 5/6. Patches accepted for other browsers' ideas of Javascript. -- Michael Granger Rubymage, Believer, Architect The FaerieMUD Consortium