Creates a select over the given channels. @param channels the channels to select from @return a new ChannelSelect
(AsyncChannel<?>... channels)
| 62 | * @return a new ChannelSelect |
| 63 | */ |
| 64 | @SafeVarargs |
| 65 | public static ChannelSelect from(AsyncChannel<?>... channels) { |
| 66 | Objects.requireNonNull(channels, "channels must not be null"); |
| 67 | if (channels.length == 0) { |
| 68 | throw new IllegalArgumentException("At least one channel is required"); |
| 69 | } |
| 70 | return new ChannelSelect(List.of(channels)); |
| 71 | } |
| 72 | |
| 73 | /** |
| 74 | * Waits for the first value available from any of the channels. |