Description
After much testing and futzing about with select, I found that I had to abandon it as it didn't scale well into the 1000s of channels. Instead, I've had to resort to wrapping the channel and intercepting Send calls in order to deal with avoiding blocks and scheduling recv. What I'd perf is to have a way to register a callback when the message queue, for a receiver, transitions from empty to non-empty and for a sender, transitions from full to non-full. That would allow me to no longer need to wrap. I'd then be able to remove the code I have that schedules a receiver task when sending. I'd also be able to drop the polling code that sends when the channel is full. You can see my unfortunate implementation of this in d3-core. I haven't look at how difficult it might be to implement, but I'd be willing to take on that task if you'd like to assign it to me.