[libmill] Re: wait for multiple fds

  • From: Martin Sustrik <sustrik@xxxxxxxxxx>
  • To: libmill@xxxxxxxxxxxxx
  • Date: Mon, 27 Jul 2015 07:10:53 +0200

On 2015-07-26 17:29, Delio Brignoli wrote:

The equivalent of my pseudocode above would do something when ch1 and
ch2 'returned' something and ch3 did not, and do something different
otherwise. I think 'choose' can do what I want and was just wondering
if there was a better way.

Considering all the answers to my original email I see that limiting
to 'wait for a single fd' is deliberate and consider my original
question answered. Thank you all.

It was deliberate but that doesn't mean the design decition cannot be revisited.

As for choose{} that doesn't seem to fit. It returns 1 channel when active (if multiple are, it chooses one at random) and there's no way to check for channel not being acive.

Even the standard POSIX polling mechanisms don't allow to poll for "not active" state.

It would probably help if we understood your use case better. What are you tring to achieve?

Martin

Other related posts: