mozilla/rust — pull request #9746 by FlaPer87 (2013-10-07 07:27:04+00:00)
Title: Make UvTImer selectable and implement recv_timeout

**NOTE** This is not ready to be merged, it's a work in progress idea.

I'm looking for feedback on the `SelectInner` implementation for UvTimer. The idea I came up with is to have a `select_then` method that takes a callback and calls it right after starting the watcher. The reason why this is needed is that libuv IO has to happen within it's own scheduler and before switching back to the main scheduler the timer has to have completed or stopped.

In `sleep_then` callback, users will be able to either deschedule the task themselves or sleep on multiple 'selectable' objects and wake up the task at the first event.

Thoughts?