akka.stream.scaladsl

Source

final class Source[+Out, +Mat] extends FlowOps[Out, Mat] with Graph[SourceShape[Out], Mat]

A Source is a set of stream processing steps that has one open output. It can comprise any number of internal sources and transformations that are wired together, or it can be an “atomic” source, e.g. from a collection or a file. Materialization turns a Source into a Reactive Streams Publisher (at least conceptually).

Source
Source.scala
Linear Supertypes
Graph[SourceShape[Out], Mat], FlowOps[Out, Mat], AnyRef, Any
Type Hierarchy Learn more about scaladoc diagrams
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Source
  2. Graph
  3. FlowOps
  4. AnyRef
  5. Any
Implicitly
  1. by any2stringadd
  2. by any2stringfmt
  3. by any2ArrowAssoc
  4. by any2Ensuring
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Source(module: Module)

Type Members

  1. type Repr[+O, +M] = Source[O, M]

    Definition Classes
    SourceFlowOps
  2. type Shape = SourceShape[Out]

    Type-level accessor for the shape parameter of this graph.

    Type-level accessor for the shape parameter of this graph.

    Definition Classes
    Graph

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def +(other: String): String

    Implicit information
    This member is added by an implicit conversion from Source[Out, Mat] to StringAdd performed by method any2stringadd in scala.Predef.
    Definition Classes
    StringAdd
  5. def ++[Out2 >: Out, M](second: Graph[SourceShape[Out2], M]): Source[Out2, (Mat, M)]

    Concatenates a second source so that the first element emitted by that source is emitted after the last element of this source.

    Concatenates a second source so that the first element emitted by that source is emitted after the last element of this source.

    This is a shorthand for concat

  6. def ->[B](y: B): (Source[Out, Mat], B)

    Implicit information
    This member is added by an implicit conversion from Source[Out, Mat] to ArrowAssoc[Source[Out, Mat]] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  7. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  8. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  9. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  10. def asJava: javadsl.Source[Out, Mat]

    Converts this Scala DSL element to it's Java DSL counterpart.

  11. def buffer(size: Int, overflowStrategy: OverflowStrategy): Repr[Out, Mat]

    Adds a fixed size buffer in the flow that allows to store elements from a faster upstream until it becomes full.

    Adds a fixed size buffer in the flow that allows to store elements from a faster upstream until it becomes full. Depending on the defined akka.stream.OverflowStrategy it might drop elements or backpressure the upstream if there is no space available

    Emits when downstream stops backpressuring and there is a pending element in the buffer

    Backpressures when depending on OverflowStrategy * Backpressure - backpressures when buffer is full * DropHead, DropTail, DropBuffer - never backpressures * Fail - fails the stream if buffer gets full

    Completes when upstream completes and buffered elements has been drained

    Cancels when downstream cancels

    size

    The size of the buffer in element count

    overflowStrategy

    Strategy that is used when incoming elements cannot fit inside the buffer

    Definition Classes
    FlowOps
  12. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  13. def collect[T](pf: PartialFunction[Out, T]): Repr[T, Mat]

    Transform this stream by applying the given partial function to each of the elements on which the function is defined as they pass through this processing step.

    Transform this stream by applying the given partial function to each of the elements on which the function is defined as they pass through this processing step. Non-matching elements are filtered out.

    Emits when the provided partial function is defined for the element

    Backpressures when the partial function is defined for the element and downstream backpressures

    Completes when upstream completes

    Cancels when downstream cancels

    Definition Classes
    FlowOps
  14. def concat[Out2 >: Out, M](second: Graph[SourceShape[Out2], M]): Source[Out2, (Mat, M)]

    Concatenates a second source so that the first element emitted by that source is emitted after the last element of this source.

  15. def concatMat[Out2 >: Out, Mat2, Mat3](second: Graph[SourceShape[Out2], Mat2])(combine: (Mat, Mat2) ⇒ Mat3): Source[Out2, Mat3]

    Concatenates a second source so that the first element emitted by that source is emitted after the last element of this source.

  16. def conflate[S](seed: (Out) ⇒ S)(aggregate: (S, Out) ⇒ S): Repr[S, Mat]

    Allows a faster upstream to progress independently of a slower subscriber by conflating elements into a summary until the subscriber is ready to accept them.

    Allows a faster upstream to progress independently of a slower subscriber by conflating elements into a summary until the subscriber is ready to accept them. For example a conflate step might average incoming numbers if the upstream publisher is faster.

    This element only rolls up elements if the upstream is faster, but if the downstream is faster it will not duplicate elements.

    Emits when downstream stops backpressuring and there is a conflated element available

    Backpressures when never

    Completes when upstream completes

    Cancels when downstream cancels

    seed

    Provides the first state for a conflated value using the first unconsumed element as a start

    aggregate

    Takes the currently aggregated value and the current pending element to produce a new aggregate

    Definition Classes
    FlowOps
  17. def drop(n: Long): Repr[Out, Mat]

    Discard the given number of elements at the beginning of the stream.

    Discard the given number of elements at the beginning of the stream. No elements will be dropped if n is zero or negative.

    Emits when the specified number of elements has been dropped already

    Backpressures when the specified number of elements has been dropped and downstream backpressures

    Completes when upstream completes

    Cancels when downstream cancels

    Definition Classes
    FlowOps
  18. def dropWhile(p: (Out) ⇒ Boolean): Repr[Out, Mat]

    Discard elements at the beginning of the stream while predicate is true.

    Discard elements at the beginning of the stream while predicate is true. All elements will be taken after predicate returns false first time.

    Emits when predicate returned false and for all following stream elements

    Backpressures when predicate returned false and downstream backpressures

    Completes when upstream completes

    Cancels when downstream cancels

    Definition Classes
    FlowOps
  19. def dropWithin(d: FiniteDuration): Repr[Out, Mat]

    Discard the elements received within the given duration at beginning of the stream.

    Discard the elements received within the given duration at beginning of the stream.

    Emits when the specified time elapsed and a new upstream element arrives

    Backpressures when downstream backpressures

    Completes when upstream completes

    Cancels when downstream cancels

    Definition Classes
    FlowOps
  20. def ensuring(cond: (Source[Out, Mat]) ⇒ Boolean, msg: ⇒ Any): Source[Out, Mat]

    Implicit information
    This member is added by an implicit conversion from Source[Out, Mat] to Ensuring[Source[Out, Mat]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  21. def ensuring(cond: (Source[Out, Mat]) ⇒ Boolean): Source[Out, Mat]

    Implicit information
    This member is added by an implicit conversion from Source[Out, Mat] to Ensuring[Source[Out, Mat]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  22. def ensuring(cond: Boolean, msg: ⇒ Any): Source[Out, Mat]

    Implicit information
    This member is added by an implicit conversion from Source[Out, Mat] to Ensuring[Source[Out, Mat]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  23. def ensuring(cond: Boolean): Source[Out, Mat]

    Implicit information
    This member is added by an implicit conversion from Source[Out, Mat] to Ensuring[Source[Out, Mat]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  24. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  25. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  26. def expand[S, U](seed: (Out) ⇒ S)(extrapolate: (S) ⇒ (U, S)): Repr[U, Mat]

    Allows a faster downstream to progress independently of a slower publisher by extrapolating elements from an older element until new element comes from the upstream.

    Allows a faster downstream to progress independently of a slower publisher by extrapolating elements from an older element until new element comes from the upstream. For example an expand step might repeat the last element for the subscriber until it receives an update from upstream.

    This element will never "drop" upstream elements as all elements go through at least one extrapolation step. This means that if the upstream is actually faster than the upstream it will be backpressured by the downstream subscriber.

    Expand does not support akka.stream.Supervision.Restart and akka.stream.Supervision.Resume. Exceptions from the seed or extrapolate functions will complete the stream with failure.

    Emits when downstream stops backpressuring

    Backpressures when downstream backpressures

    Completes when upstream completes

    Cancels when downstream cancels

    seed

    Provides the first state for extrapolation using the first unconsumed element

    extrapolate

    Takes the current extrapolation state to produce an output element and the next extrapolation state.

    Definition Classes
    FlowOps
  27. def filter(p: (Out) ⇒ Boolean): Repr[Out, Mat]

    Only pass on those elements that satisfy the given predicate.

    Only pass on those elements that satisfy the given predicate.

    Emits when the given predicate returns true for the element

    Backpressures when the given predicate returns true for the element and downstream backpressures

    Completes when upstream completes

    Cancels when downstream cancels

    Definition Classes
    FlowOps
  28. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  29. def flatten[U](strategy: FlattenStrategy[Out, U]): Repr[U, Mat]

    Transforms a stream of streams into a contiguous stream of elements using the provided flattening strategy.

    Transforms a stream of streams into a contiguous stream of elements using the provided flattening strategy. This operation can be used on a stream of element type akka.stream.scaladsl.Source.

    Emits when (Concat) the current consumed substream has an element available

    Backpressures when downstream backpressures

    Completes when upstream completes and all consumed substreams complete

    Cancels when downstream cancels

    Definition Classes
    FlowOps
  30. def fold[T](zero: T)(f: (T, Out) ⇒ T): Repr[T, Mat]

    Similar to scan but only emits its result when the upstream completes, after which it also completes.

    Similar to scan but only emits its result when the upstream completes, after which it also completes. Applies the given function towards its current and next value, yielding the next current value.

    If the function f throws an exception and the supervision decision is akka.stream.Supervision.Restart current value starts at zero again the stream will continue.

    Emits when upstream completes

    Backpressures when downstream backpressures

    Completes when upstream completes

    Cancels when downstream cancels

    Definition Classes
    FlowOps
  31. def formatted(fmtstr: String): String

    Implicit information
    This member is added by an implicit conversion from Source[Out, Mat] to StringFormat performed by method any2stringfmt in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  32. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  33. def groupBy[K, U >: Out](f: (Out) ⇒ K): Repr[(K, Source[U, Unit]), Mat]

    This operation demultiplexes the incoming stream into separate output streams, one for each element key.

    This operation demultiplexes the incoming stream into separate output streams, one for each element key. The key is computed for each element using the given function. When a new key is encountered for the first time it is emitted to the downstream subscriber together with a fresh flow that will eventually produce all the elements of the substream for that key. Not consuming the elements from the created streams will stop this processor from processing more elements, therefore you must take care to unblock (or cancel) all of the produced streams even if you want to consume only one of them.

    If the group by function f throws an exception and the supervision decision is akka.stream.Supervision.Stop the stream and substreams will be completed with failure.

    If the group by function f throws an exception and the supervision decision is akka.stream.Supervision.Resume or akka.stream.Supervision.Restart the element is dropped and the stream and substreams continue.

    Emits when an element for which the grouping function returns a group that has not yet been created. Emits the new group

    Backpressures when there is an element pending for a group whose substream backpressures

    Completes when upstream completes

    Cancels when downstream cancels and all substreams cancel

    Definition Classes
    FlowOps
  34. def grouped(n: Int): Repr[Seq[Out], Mat]

    Chunk up this stream into groups of the given size, with the last group possibly smaller than requested due to end-of-stream.

    Chunk up this stream into groups of the given size, with the last group possibly smaller than requested due to end-of-stream.

    n must be positive, otherwise IllegalArgumentException is thrown.

    Emits when the specified number of elements has been accumulated or upstream completed

    Backpressures when a group has been assembled and downstream backpressures

    Completes when upstream completes

    Cancels when downstream cancels

    Definition Classes
    FlowOps
  35. def groupedWithin(n: Int, d: FiniteDuration): Repr[Seq[Out], Mat]

    Chunk up this stream into groups of elements received within a time window, or limited by the given number of elements, whatever happens first.

    Chunk up this stream into groups of elements received within a time window, or limited by the given number of elements, whatever happens first. Empty groups will not be emitted if no elements are received from upstream. The last group before end-of-stream will contain the buffered elements since the previously emitted group.

    n must be positive, and d must be greater than 0 seconds, otherwise IllegalArgumentException is thrown.

    Emits when the configured time elapses since the last group has been emitted

    Backpressures when the configured time elapses since the last group has been emitted

    Completes when upstream completes (emits last group)

    Cancels when downstream completes

    Definition Classes
    FlowOps
  36. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  37. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  38. def log(name: String, extract: (Out) ⇒ Any = _identity)(implicit log: LoggingAdapter = null): Repr[Out, Mat]

    Logs elements flowing through the stream as well as completion and erroring.

    Logs elements flowing through the stream as well as completion and erroring.

    By default element and completion signals are logged on debug level, and errors are logged on Error level. This can be adjusted according to your needs by providing a custom Attributes.LogLevels atrribute on the given Flow:

    Uses implicit LoggingAdapter if available, otherwise uses an internally created one, which uses akka.stream.Log as it's source (use this class to configure slf4j loggers).

    Emits when the mapping function returns an element

    Backpressures when downstream backpressures

    Completes when upstream completes

    Cancels when downstream cancels

    Definition Classes
    FlowOps
  39. def map[T](f: (Out) ⇒ T): Repr[T, Mat]

    Transform this stream by applying the given function to each of the elements as they pass through this processing step.

    Transform this stream by applying the given function to each of the elements as they pass through this processing step.

    Emits when the mapping function returns an element

    Backpressures when downstream backpressures

    Completes when upstream completes

    Cancels when downstream cancels

    Definition Classes
    FlowOps
  40. def mapAsync[T](parallelism: Int)(f: (Out) ⇒ Future[T]): Repr[T, Mat]

    Transform this stream by applying the given function to each of the elements as they pass through this processing step.

    Transform this stream by applying the given function to each of the elements as they pass through this processing step. The function returns a Future and the value of that future will be emitted downstream. The number of Futures that shall run in parallel is given as the first argument to mapAsync. These Futures may complete in any order, but the elements that are emitted downstream are in the same order as received from upstream.

    If the group by function f throws an exception or if the Future is completed with failure and the supervision decision is akka.stream.Supervision.Stop the stream will be completed with failure.

    If the group by function f throws an exception or if the Future is completed with failure and the supervision decision is akka.stream.Supervision.Resume or akka.stream.Supervision.Restart the element is dropped and the stream continues.

    Emits when the Future returned by the provided function finishes for the next element in sequence

    Backpressures when the number of futures reaches the configured parallelism and the downstream backpressures or the first future is not completed

    Completes when upstream completes and all futures has been completed and all elements has been emitted

    Cancels when downstream cancels

    Definition Classes
    FlowOps
    See also

    #mapAsyncUnordered

  41. def mapAsyncUnordered[T](parallelism: Int)(f: (Out) ⇒ Future[T]): Repr[T, Mat]

    Transform this stream by applying the given function to each of the elements as they pass through this processing step.

    Transform this stream by applying the given function to each of the elements as they pass through this processing step. The function returns a Future and the value of that future will be emitted downstreams. As many futures as requested elements by downstream may run in parallel and each processed element will be emitted dowstream as soon as it is ready, i.e. it is possible that the elements are not emitted downstream in the same order as received from upstream.

    If the group by function f throws an exception or if the Future is completed with failure and the supervision decision is akka.stream.Supervision.Stop the stream will be completed with failure.

    If the group by function f throws an exception or if the Future is completed with failure and the supervision decision is akka.stream.Supervision.Resume or akka.stream.Supervision.Restart the element is dropped and the stream continues.

    Emits when any of the Futures returned by the provided function complete

    Backpressures when the number of futures reaches the configured parallelism and the downstream backpressures

    Completes when upstream completes and all futures has been completed and all elements has been emitted

    Cancels when downstream cancels

    Definition Classes
    FlowOps
    See also

    #mapAsync

  42. def mapConcat[T](f: (Out) ⇒ Iterable[T]): Repr[T, Mat]

    Transform each input element into an Iterable of output elements that is then flattened into the output stream.

    Transform each input element into an Iterable of output elements that is then flattened into the output stream.

    The returned Iterable MUST NOT contain null values, as they are illegal as stream elements - according to the Reactive Streams specification.

    Emits when the mapping function returns an element or there are still remaining elements from the previously calculated collection

    Backpressures when downstream backpressures or there are still remaining elements from the previously calculated collection

    Completes when upstream completes and all remaining elements has been emitted

    Cancels when downstream cancels

    Definition Classes
    FlowOps
  43. def mapMaterializedValue[Mat2](f: (Mat) ⇒ Mat2): Repr[Out, Mat2]

    Transform only the materialized value of this Source, leaving all other properties as they were.

  44. def named(name: String): Repr[Out, Mat]

    Definition Classes
    SourceGraph
  45. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  46. final def notify(): Unit

    Definition Classes
    AnyRef
  47. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  48. def prefixAndTail[U >: Out](n: Int): Repr[(Seq[Out], Source[U, Unit]), Mat]

    Takes up to n elements from the stream (less than n only if the upstream completes before emitting n elements) and returns a pair containing a strict sequence of the taken element and a stream representing the remaining elements.

    Takes up to n elements from the stream (less than n only if the upstream completes before emitting n elements) and returns a pair containing a strict sequence of the taken element and a stream representing the remaining elements. If n is zero or negative, then this will return a pair of an empty collection and a stream containing the whole upstream unchanged.

    In case of an upstream error, depending on the current state

    • the master stream signals the error if less than n elements has been seen, and therefore the substream has not yet been emitted
    • the tail substream signals the error after the prefix and tail has been emitted by the main stream (at that point the main stream has already completed)

    Emits when the configured number of prefix elements are available. Emits this prefix, and the rest as a substream

    Backpressures when downstream backpressures or substream backpressures

    Completes when prefix elements has been consumed and substream has been consumed

    Cancels when downstream cancels or substream cancels

    Definition Classes
    FlowOps
  49. def recover[T >: Out](pf: PartialFunction[Throwable, T]): Repr[T, Mat]

    Recover allows to send last element on failure and gracefully complete the stream Since the underlying failure signal onError arrives out-of-band, it might jump over existing elements.

    Recover allows to send last element on failure and gracefully complete the stream Since the underlying failure signal onError arrives out-of-band, it might jump over existing elements. This stage can recover the failure signal, but not the skipped elements, which will be dropped.

    Emits when element is available from the upstream or upstream is failed and pf returns an element

    Backpressures when downstream backpressures

    Completes when upstream completes or upstream failed with exception pf can handle

    Cancels when downstream cancels

    Definition Classes
    FlowOps
  50. def runFold[U](zero: U)(f: (U, Out) ⇒ U)(implicit materializer: Materializer): Future[U]

    Shortcut for running this Source with a fold function.

    Shortcut for running this Source with a fold function. The given function is invoked for every received element, giving it its previous output (or the given zero value) and the element as input. The returned scala.concurrent.Future will be completed with value of the final function evaluation when the input stream ends, or completed with Failure if there is a failure signaled in the stream.

  51. def runForeach(f: (Out) ⇒ Unit)(implicit materializer: Materializer): Future[Unit]

    Shortcut for running this Source with a foreach procedure.

    Shortcut for running this Source with a foreach procedure. The given procedure is invoked for each received element. The returned scala.concurrent.Future will be completed with Success when reaching the normal end of the stream, or completed with Failure if there is a failure signaled in the stream.

  52. def runWith[Mat2](sink: Graph[SinkShape[Out], Mat2])(implicit materializer: Materializer): Mat2

    Connect this Source to a Sink and run it.

    Connect this Source to a Sink and run it. The returned value is the materialized value of the Sink, e.g. the Publisher of a akka.stream.scaladsl.Sink#publisher.

  53. def scan[T](zero: T)(f: (T, Out) ⇒ T): Repr[T, Mat]

    Similar to fold but is not a terminal operation, emits its current value which starts at zero and then applies the current and next value to the given function f, emitting the next current value.

    Similar to fold but is not a terminal operation, emits its current value which starts at zero and then applies the current and next value to the given function f, emitting the next current value.

    If the function f throws an exception and the supervision decision is akka.stream.Supervision.Restart current value starts at zero again the stream will continue.

    Emits when the function scanning the element returns a new element

    Backpressures when downstream backpressures

    Completes when upstream completes

    Cancels when downstream cancels

    Definition Classes
    FlowOps
  54. val shape: SourceShape[Out]

    The shape of a graph is all that is externally visible: its inlets and outlets.

    The shape of a graph is all that is externally visible: its inlets and outlets.

    Definition Classes
    SourceGraph
  55. def splitAfter[U >: Out](p: (Out) ⇒ Boolean): Repr[Source[U, Unit], Mat]

    This operation applies the given predicate to all incoming elements and emits them to a stream of output streams.

    This operation applies the given predicate to all incoming elements and emits them to a stream of output streams. It *ends* the current substream when the predicate is true. This means that for the following series of predicate values, three substreams will be produced with lengths 2, 2, and 3:

    false, true,        // elements go into first substream
    false, true,        // elements go into second substream
    false, false, true  // elements go into third substream

    If the split predicate p throws an exception and the supervision decision is akka.stream.Supervision.Stop the stream and substreams will be completed with failure.

    If the split predicate p throws an exception and the supervision decision is akka.stream.Supervision.Resume or akka.stream.Supervision.Restart the element is dropped and the stream and substreams continue.

    Emits when an element passes through. When the provided predicate is true it emitts the element and opens a new substream for subsequent element

    Backpressures when there is an element pending for the next substream, but the previous is not fully consumed yet, or the substream backpressures

    Completes when upstream completes

    Cancels when downstream cancels and substreams cancel

    See also FlowOps.splitAfter.

    Definition Classes
    FlowOps
  56. def splitWhen[U >: Out](p: (Out) ⇒ Boolean): Repr[Source[U, Unit], Mat]

    This operation applies the given predicate to all incoming elements and emits them to a stream of output streams, always beginning a new one with the current element if the given predicate returns true for it.

    This operation applies the given predicate to all incoming elements and emits them to a stream of output streams, always beginning a new one with the current element if the given predicate returns true for it. This means that for the following series of predicate values, three substreams will be produced with lengths 1, 2, and 3:

    false,             // element goes into first substream
    true, false,       // elements go into second substream
    true, false, false // elements go into third substream

    In case the *first* element of the stream matches the predicate, the first substream emitted by splitWhen will start from that element. For example:

    true, false, false // first substream starts from the split-by element
    true, false        // subsequent substreams operate the same way

    If the split predicate p throws an exception and the supervision decision is akka.stream.Supervision.Stop the stream and substreams will be completed with failure.

    If the split predicate p throws an exception and the supervision decision is akka.stream.Supervision.Resume or akka.stream.Supervision.Restart the element is dropped and the stream and substreams continue.

    Emits when an element for which the provided predicate is true, opening and emitting a new substream for subsequent element

    Backpressures when there is an element pending for the next substream, but the previous is not fully consumed yet, or the substream backpressures

    Completes when upstream completes

    Cancels when downstream cancels and substreams cancel

    Definition Classes
    FlowOps
  57. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  58. def take(n: Long): Repr[Out, Mat]

    Terminate processing (and cancel the upstream publisher) after the given number of elements.

    Terminate processing (and cancel the upstream publisher) after the given number of elements. Due to input buffering some elements may have been requested from upstream publishers that will then not be processed downstream of this step.

    The stream will be completed without producing any elements if n is zero or negative.

    Emits when the specified number of elements to take has not yet been reached

    Backpressures when downstream backpressures

    Completes when the defined number of elements has been taken or upstream completes

    Cancels when the defined number of elements has been taken or downstream cancels

    Definition Classes
    FlowOps
  59. def takeWhile(p: (Out) ⇒ Boolean): Repr[Out, Mat]

    Terminate processing (and cancel the upstream publisher) after predicate returns false for the first time.

    Terminate processing (and cancel the upstream publisher) after predicate returns false for the first time. Due to input buffering some elements may have been requested from upstream publishers that will then not be processed downstream of this step.

    The stream will be completed without producing any elements if predicate is false for the first stream element.

    Emits when the predicate is true

    Backpressures when downstream backpressures

    Completes when predicate returned false or upstream completes

    Cancels when predicate returned false or downstream cancels

    Definition Classes
    FlowOps
  60. def takeWithin(d: FiniteDuration): Repr[Out, Mat]

    Terminate processing (and cancel the upstream publisher) after the given duration.

    Terminate processing (and cancel the upstream publisher) after the given duration. Due to input buffering some elements may have been requested from upstream publishers that will then not be processed downstream of this step.

    Note that this can be combined with #take to limit the number of elements within the duration.

    Emits when an upstream element arrives

    Backpressures when downstream backpressures

    Completes when upstream completes or timer fires

    Cancels when downstream cancels or timer fires

    Definition Classes
    FlowOps
  61. def to[Mat2](sink: Graph[SinkShape[Out], Mat2]): RunnableGraph[Mat]

    Connect this akka.stream.scaladsl.Source to a akka.stream.scaladsl.Sink, concatenating the processing steps of both.

  62. def toMat[Mat2, Mat3](sink: Graph[SinkShape[Out], Mat2])(combine: (Mat, Mat2) ⇒ Mat3): RunnableGraph[Mat3]

    Connect this akka.stream.scaladsl.Source to a akka.stream.scaladsl.Sink, concatenating the processing steps of both.

  63. def toString(): String

    Definition Classes
    AnyRef → Any
  64. def transform[T](mkStage: () ⇒ Stage[Out, T]): Repr[T, Mat]

    Generic transformation of a stream with a custom processing akka.stream.stage.Stage.

    Generic transformation of a stream with a custom processing akka.stream.stage.Stage. This operator makes it possible to extend the Flow API when there is no specialized operator that performs the transformation.

    Definition Classes
    FlowOps
  65. def via[T, Mat2](flow: Graph[FlowShape[Out, T], Mat2]): Source[T, Mat]

    Transform this akka.stream.scaladsl.Source by appending the given processing stages.

  66. def viaMat[T, Mat2, Mat3](flow: Graph[FlowShape[Out, T], Mat2])(combine: (Mat, Mat2) ⇒ Mat3): Source[T, Mat3]

    Transform this akka.stream.scaladsl.Source by appending the given processing stages.

  67. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  68. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  69. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  70. def withAttributes(attr: Attributes): Repr[Out, Mat]

    Nests the current Source and returns a Source with the given Attributes

    Nests the current Source and returns a Source with the given Attributes

    attr

    the attributes to add

    returns

    a new Source with the added attributes

    Definition Classes
    SourceGraphFlowOps
  71. def [B](y: B): (Source[Out, Mat], B)

    Implicit information
    This member is added by an implicit conversion from Source[Out, Mat] to ArrowAssoc[Source[Out, Mat]] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Shadowed Implicit Value Members

  1. val self: Any

    Implicit information
    This member is added by an implicit conversion from Source[Out, Mat] to StringAdd performed by method any2stringadd in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (source: StringAdd).self
    Definition Classes
    StringAdd
  2. val self: Any

    Implicit information
    This member is added by an implicit conversion from Source[Out, Mat] to StringFormat performed by method any2stringfmt in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (source: StringFormat).self
    Definition Classes
    StringFormat

Deprecated Value Members

  1. def x: Source[Out, Mat]

    Implicit information
    This member is added by an implicit conversion from Source[Out, Mat] to ArrowAssoc[Source[Out, Mat]] performed by method any2ArrowAssoc in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (source: ArrowAssoc[Source[Out, Mat]]).x
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use leftOfArrow instead

  2. def x: Source[Out, Mat]

    Implicit information
    This member is added by an implicit conversion from Source[Out, Mat] to Ensuring[Source[Out, Mat]] performed by method any2Ensuring in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (source: Ensuring[Source[Out, Mat]]).x
    Definition Classes
    Ensuring
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use resultOfEnsuring instead

Inherited from Graph[SourceShape[Out], Mat]

Inherited from FlowOps[Out, Mat]

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from Source[Out, Mat] to StringAdd

Inherited by implicit conversion any2stringfmt from Source[Out, Mat] to StringFormat

Inherited by implicit conversion any2ArrowAssoc from Source[Out, Mat] to ArrowAssoc[Source[Out, Mat]]

Inherited by implicit conversion any2Ensuring from Source[Out, Mat] to Ensuring[Source[Out, Mat]]

Ungrouped