ReadChannel

trait ReadChannel[F[_], A]

ReadChannel: Interface providing asynchronous reading API.

Companion
object
Source
ReadChannel.scala
class Object
trait Matchable
class Any
trait Channel[F, W, R]
class ChannelWithExpiration[F, W, R]
class ChFlatMappedChannel[F, W, RA, RB]
class FilteredAsyncChannel[F, W, R]
class FilteredChannel[F, W, R]
class MappedAsyncChannel[F, W, RA, RB]
class MappedChannel[F, W, RA, RB]
class PromiseChannel[F, A]
class AppendReadChannel[F, A]
class MappedAsyncReadChannel[F, A, B]
class MappedReadChannel[F, A, B]
class OrReadChannel[F, A]

Type members

Classlikes

class DoneReadChannel extends ReadChannel[F, Unit]
class SimpleReader(f: Try[A] => Unit) extends Reader[A]

Types

type done = Unit
type read = A

Special type which is used in select statement.

Special type which is used in select statement.

See also

[gopher.Select]

Source
ReadChannel.scala

Value members

Abstract methods

def addDoneReader(reader: Reader[Unit]): Unit
def addReader(reader: Reader[A]): Unit

Concrete methods

transparent inline
def ?: A

Synonim for read.

Synonim for read.

Source
ReadChannel.scala
def aOptRead(): F[Option[A]]

read value and return future with

read value and return future with

  • Some(value) if value is available to read
  • None if stream is closed.
Source
ReadChannel.scala
def afold[S](s0: S)(f: (S, A) => S): F[S]
def afold_async[S](s0: S)(f: (S, A) => F[S]): F[S]
def aforeach(f: A => Unit): F[Unit]
def aforeach_async(f: A => F[Unit]): F[F[Unit]]
def append(other: ReadChannel[F, A]): ReadChannel[F, A]
def aread(): F[A]

async version of read. Immediatly return future, which will contains result of read or failur with StreamClosedException in case of stream is closed.

async version of read. Immediatly return future, which will contains result of read or failur with StreamClosedException in case of stream is closed.

Source
ReadChannel.scala
def asyncMonad: CpsSchedulingMonad[F]
def atake(n: Int): F[IndexedSeq[A]]

return F which contains sequence from first n elements.

return F which contains sequence from first n elements.

Source
ReadChannel.scala
def dup(bufSize: Int, expiration: Duration): (ReadChannel[F, A], ReadChannel[F, A])
def filter(p: A => Boolean): ReadChannel[F, A]
def filterAsync(p: A => F[Boolean]): ReadChannel[F, A]
transparent inline
def fold[S](inline s0: S)(inline f: (S, A) => S): S
def fold_async[S](s0: S)(f: (S, A) => F[S]): F[S]
transparent inline
def foreach(inline f: A => Unit): Unit

run code each time when new object is arriced. until end of stream is not reached

run code each time when new object is arriced. until end of stream is not reached

Source
ReadChannel.scala
def foreach_async(f: A => F[Unit]): F[Unit]
def map[B](f: A => B): ReadChannel[F, B]
def mapAsync[B](f: A => F[B]): ReadChannel[F, B]
transparent inline
def optRead(): Option[A]

read value and return

read value and return

  • Some(value) if value is available to read
  • None if stream is closed.

should be called inside async block.

Source
ReadChannel.scala
def or(other: ReadChannel[F, A]): ReadChannel[F, A]
transparent inline
def read(): A

blocked read: if currently not element available - wait for one. Can be used only inside async block. If stream is closed and no values to read left in the stream - throws StreamClosedException

blocked read: if currently not element available - wait for one. Can be used only inside async block. If stream is closed and no values to read left in the stream - throws StreamClosedException

Source
ReadChannel.scala
transparent inline
def take(n: Int): IndexedSeq[A]

take first n elements. should be called inside async block.

take first n elements. should be called inside async block.

Source
ReadChannel.scala
def zip[B](x: ReadChannel[F, B]): ReadChannel[F, (A, B)]
def |(other: ReadChannel[F, A]): ReadChannel[F, A]

Concrete fields

lazy
val done: ReadChannel[F, Unit]