github.com/IBM/fast-fan-in (go): Package fan is a type-flexible fan-in pattern implementation  This package provides convenient and efficient mechanisms for combining many channels with the same element type into one channel with that element type.  For any primitive type in Go, this package provides helper methods to "fan-in" many channels with that primitive as the element type. For instance, if you have several channels of integers:  For non-primitive types, you can achieve good performance by providing an anonymous function that type-asserts the channels to the appropriate element type (avoiding reflection on the hot path):  This small bit of boilerplate captures the necessary type information to avoid performing any reflection while passing data read from the channels, resulting in the same throughput as a custom implementation for your type.  All SelectFunc implementations look essentially the same, with the only difference being the element type of the channels in the two type assertions.  If your use-case is not performance-critical, we also provide a reflection-based fallback implementation which is used when no SelectFunc is provided. See [benchmarks](#benchmarks) to understand the performance effect of this implementation.  To use the inefficient reflection-based approach on a custom type, you can do:
Keywords: channels|concurrency|fan-in|go