Syntax

    When the select macro is evaluated, all the <async expression>s are aggregated and executed concurrently. When an expression completes, the result is matched against <pattern>. If the result matches the pattern, then all remaining async expressions are dropped and <handler> is executed. The <handler> expression has access to any bindings established by .

    If <pattern> does not match the result of the async computation, then the remaining async expressions continue to execute concurrently until the next one completes. At this time, the same logic is applied to that result.

    Here, we select on the output of a oneshot channel and a TCP connection.

    The accept loop runs until an error is encountered or rx receives a value. The pattern indicates that we have no interest in the return value of the async computation.