Select
Organize waiting for read/write from multiple async channels
Gopher[F] provide a function select
of this type.
class Object
trait Matchable
class Any
Value members
Concrete methods
wait until some channels from the list in <code> pf </code>.
wait until some channels from the list in <code> pf </code>.
async{
....
select {
case vx:xChannel.read => doSomethingWithX
case vy:yChannel.write if (vy == valueToWrite) => doSomethingAfterWrite(vy)
case t: Time.after if (t == 1.minute) => processTimeout
}
...
}