On Wed, Dec 05, 2007 at 05:40:47PM -0700, Rusty Conover <[EMAIL PROTECTED]> wrote: > I'm looking into using EV rather then Event for my needs but it seems > the I/O timers don't have a nice way to schedule both a timeout and a > I/O callback at the same time into the same callback.
Thats a feature, and compared to Event, actually a bugfix. > Such as setting the timeout parameter to the IO watcher. > > Is this just my oversight or a design decision? Its a design decision. Combining timers with io watchers is unnatural, because: - you often don't need both, so shouldn't be forced to pay for them - you can't choose the type of timeout (event only has absolute timers anyways, though, which are unsuitable for many tasks such as idle timeouts for i/o, where you need relative timeouts). - you have to manage two timeouts or weirder stuff when you have two separate i/o watchers, or use a third watcher (paying even more). - it is often unclear on which events exactly the timeout gets reset (if at all), and even if not, there is no flexibility (how do you chose between an idle timeout and an overall timeout for completion with Event? you cannot). As it is trivial to create a separate timeout (and much faster than with Event, too), there is no drawback to this design. It also usually leads to smaller and simpler code, once one understands ones own needs... -- The choice of a Deliantra, the free code+content MORPG -----==- _GNU_ http://www.deliantra.net ----==-- _ generation ---==---(_)__ __ ____ __ Marc Lehmann --==---/ / _ \/ // /\ \/ / [EMAIL PROTECTED] -=====/_/_//_/\_,_/ /_/\_\