Select

gopher.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.

Attributes

Source
Select.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

transparent inline def afold[S](s0: S)(inline step: (CpsMonadContext[F]) ?=> S => S | Done[S]): F[S]

Attributes

Source
Select.scala
def afold_async[S](s0: S)(step: S => F[S | Done[S]]): F[S]

Attributes

Source
Select.scala
transparent inline def aforever(inline pf: PartialFunction[Any, Unit]): F[Unit]

run forever expression in pf, return

run forever expression in pf, return

Attributes

Source
Select.scala
transparent inline def apply[A](inline pf: PartialFunction[Any, A])(using mc: CpsMonadContext[F]): 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
}
...
}

Attributes

Source
Select.scala
def fold[S](s0: S)(step: S => S | Done[S]): S

Attributes

Source
Select.scala
def fold_async[S](s0: S)(step: S => F[S | Done[S]]): F[S]

Attributes

Source
Select.scala

create forever runner.

create forever runner.

Attributes

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

create select groop

create select groop

Attributes

See also

[gopher.SelectGroup]

Source
Select.scala
def loop: SelectLoop[F]

create Select Loop.

create Select Loop.

Attributes

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

Attributes

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

Attributes

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

Attributes

Source
Select.scala