oh man, so this is a fun one, one of my team membe...
# coroutines
g
oh man, so this is a fun one, one of my team members wrote a select statement like this:
Copy code
inputChannel.send(Input(inputValues))
select<Result> {
  successChannel.onReceieve { Success }
  errorChannel.onReceieve { Failed }
  onTimeout(timeoutduration) {
    inputChannel.send(CancellationRequest())
    select<Unit> {
      errorChannel.onReceive { Unit }
      successChannel.onReceive { Unit }
    }
  }
}
Is that legal? I've only ever thought of the transform provided to
onReceive
as a (ref-transparent) adapter. Can I safely use it like this (avoiding races on
errorChannel
and
successChannel
?)