Source

ox.channels.Source
See theSource companion object
trait Source[+T] extends SourceOps[T], Stateful

Attributes

Companion
object
Graph
Supertypes
trait Stateful
trait SourceOps[T]
class Object
trait Matchable
class Any
Known subtypes
trait Channel[T]
class BufferedChannel[T]
class DirectChannel[T]
class CollectSource[T, U]

Members list

Type members

Classlikes

case class Receive extends SelectClause[T]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait SelectClause[T]
class Object
trait Matchable
class Any
Show all
case class Received extends SelectResult[T]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait SelectResult[T]
class Object
trait Matchable
class Any
Show all

Value members

Abstract methods

def receive(): T | ChannelClosed

Concrete methods

Inherited methods

def applied[U](f: Source[T] => U): U

Attributes

Inherited from:
SourceOps
def collectAsView[U](f: PartialFunction[T, U]): Source[U]

Attributes

Inherited from:
SourceOps
def concat[U >: T](other: Source[U])(using Ox, StageCapacity): Source[U]

Attributes

Inherited from:
SourceOps
def drain(): Unit

Receives all elements from the channel. Blocks until the channel is done.

Receives all elements from the channel. Blocks until the channel is done.

Attributes

Throws
ChannelClosedException

when there is an upstream error.

Inherited from:
SourceOps
def filter(f: T => Boolean)(using Ox, StageCapacity): Source[T]

Attributes

Inherited from:
SourceOps
def filterAsView(f: T => Boolean): Source[T]

Attributes

Inherited from:
SourceOps
def foreach(f: T => Unit): Unit

Invokes the given function for each received element. Blocks until the channel is done.

Invokes the given function for each received element. Blocks until the channel is done.

Attributes

Throws
ChannelClosedException

when there is an upstream error.

Inherited from:
SourceOps
def isClosed: Boolean

Attributes

Inherited from:
Stateful

Attributes

Inherited from:
Stateful
def isDone: Boolean

Attributes

Inherited from:
Stateful
def isError: Boolean

Attributes

Inherited from:
Stateful
def isErrorDetail: Option[Error]

Attributes

Inherited from:
Stateful
def map[U](f: T => U)(using Ox, StageCapacity): Source[U]

Attributes

Inherited from:
SourceOps
def mapAsView[U](f: T => U): Source[U]

Attributes

Inherited from:
SourceOps
def mapPar[U](parallelism: Int)(f: T => U)(using Ox, StageCapacity): Source[U]

Applies the given mapping function f to each element received from this source, and sends the results to the returned channel. At most parallelism invocations of f are run in parallel.

Applies the given mapping function f to each element received from this source, and sends the results to the returned channel. At most parallelism invocations of f are run in parallel.

The mapped results are sent to the returned channel in the same order, in which inputs are received from this source. In other words, ordering is preserved.

Errors from this channel are propagated to the returned channel. Any exceptions that occur when invoking f are propagated as errors to the returned channel as well, and result in interrupting any mappings that are in progress.

Must be run within a scope, as child forks are created, which receive from this source, send to the resulting one, and run the mappings.

Value parameters

f

The mapping function.

parallelism

An upper bound on the number of forks that run in parallel. Each fork runs the function f on a single element of the source.

Attributes

Returns

A source, onto which results of the mapping function will be sent.

Inherited from:
SourceOps
def mapParUnordered[U](parallelism: Int)(f: T => U)(using Ox, StageCapacity): Source[U]

Attributes

Inherited from:
SourceOps
def merge[U >: T](other: Source[U])(using Ox, StageCapacity): Source[U]

Attributes

Inherited from:
SourceOps
def pipeTo(sink: Sink[T]): Unit

Passes each received element from this channel to the given sink. Blocks until the channel is done.

Passes each received element from this channel to the given sink. Blocks until the channel is done.

Attributes

Throws
ChannelClosedException

when there is an upstream error, or when the sink is closed.

Inherited from:
SourceOps
def take(n: Int)(using Ox, StageCapacity): Source[T]

Attributes

Inherited from:
SourceOps
def toList: List[T]

Accumulates all elements received from the channel into a list. Blocks until the channel is done.

Accumulates all elements received from the channel into a list. Blocks until the channel is done.

Attributes

Throws
ChannelClosedException

when there is an upstream error.

Inherited from:
SourceOps
def transform[U](f: Iterator[T] => Iterator[U])(using Ox, StageCapacity): Source[U]

Attributes

Inherited from:
SourceOps
def zip[U](other: Source[U])(using Ox, StageCapacity): Source[(T, U)]

Attributes

Inherited from:
SourceOps

Concrete fields