Select

class Select[F[_]](api: Gopher[F])

Organize waiting for read/write from multiple async channels

Gopher[F] provide a function select of this type.

Source
Select.scala
class Object
trait Matchable
class Any

Value members

Concrete methods

transparent inline
def afold[S](s0: S)(inline step: S => S | Done[S]): F[S]
def afold_async[S](s0: S)(step: S => F[S | Done[S]]): F[S]
transparent inline
def aforever(inline pf: PartialFunction[Any, Unit]): F[Unit]

run forever expression in pf, return

run forever expression in pf, return

Source
Select.scala
transparent inline
def apply[A](inline pf: PartialFunction[Any, A]): A

wait until some channels from the list in pf .

wait until some channels from the list in pf .

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
}
...
}
Source
Select.scala
def fold[S](s0: S)(step: S => S | Done[S]): S
def fold_async[S](s0: S)(step: S => F[S | Done[S]]): F[S]

create forever runner.

create forever runner.

Source
Select.scala
def group[S]: SelectGroup[F, S]

create select groop

create select groop

See also

[gopher.SelectGroup]

Source
Select.scala

create Select Loop.

create Select Loop.

Source
Select.scala
def map[A](step: SelectGroup[F, A] => A): ReadChannel[F, A]
def mapAsync[A](step: SelectGroup[F, A] => F[A]): ReadChannel[F, A]
def once[S]: SelectGroup[F, S]