This package implements a highly-situational, reflection-based select statement. It allows you to construct a runtime-modifiable pool of channels that are monitored for close with a select. This is useful primarily when monitoring a pool of contexts for cancellation if you need to perform some additional cleanup after detecting the context cancellation. See the tests for some example usages.
If you don't understand why this is useful, stay away. You definitely don't need it, and it may yet prove to be a bad idea in practice.
Select implements the dynamic supervision of a pool of channels that are expected to eventually
close. You add channels to the supervised pool by sending them on the provided add channel, and channels
that close while supervised are emitted on the returned closed channel.
This function spawns a new goroutine to perform the supervision. This goroutine will shut down when
the provided add channel is closed and all supervised channels close. The returned closed channel
will close when the goroutine exits.