object Source
- Source
- Source.scala
- Alphabetic
- By Inheritance
- Source
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def actorRef[T](completionMatcher: PartialFunction[Any, CompletionStrategy], failureMatcher: PartialFunction[Any, Throwable], bufferSize: Int, overflowStrategy: OverflowStrategy): Source[T, ActorRef]
Creates a
Sourcethat is materialized as an pekko.actor.ActorRef.Creates a
Sourcethat is materialized as an pekko.actor.ActorRef. Messages sent to this actor will be emitted to the stream if there is demand from downstream, otherwise they will be buffered until request for demand is received.Depending on the defined pekko.stream.OverflowStrategy it might drop elements if there is no space available in the buffer.
The strategy pekko.stream.OverflowStrategy.backpressure is not supported, and an IllegalArgument("Backpressure overflowStrategy not supported") will be thrown if it is passed as argument.
The buffer can be disabled by using
bufferSizeof 0 and then received messages are dropped if there is no demand from downstream. WhenbufferSizeis 0 theoverflowStrategydoes not matter.The stream can be completed successfully by sending the actor reference a message that is matched by
completionMatcherin which case already buffered elements will be signaled before signaling completion.The stream can be completed with failure by sending a message that is matched by
failureMatcher. The extracted java.lang.Throwable will be used to fail the stream. In case the Actor is still draining its internal buffer (after having received a message matched bycompletionMatcher) before signaling completion and it receives a message matched byfailureMatcher, the failure will be signaled downstream immediately (instead of the completion signal).Note that terminating the actor without first completing it, either with a success or a failure, will prevent the actor triggering downstream completion and the stream will continue to run even though the source actor is dead. Therefore you should **not** attempt to manually terminate the actor such as with a pekko.actor.PoisonPill.
The actor will be stopped when the stream is completed, failed or canceled from downstream, i.e. you can watch it to get notified when that happens.
See also pekko.stream.scaladsl.Source.queue.
- completionMatcher
catches the completion message to end the stream
- failureMatcher
catches the failure message to fail the stream
- bufferSize
The size of the buffer in element count
- overflowStrategy
Strategy that is used when incoming elements cannot fit inside the buffer
- def actorRefWithBackpressure[T](ackMessage: Any, completionMatcher: PartialFunction[Any, CompletionStrategy], failureMatcher: PartialFunction[Any, Throwable]): Source[T, ActorRef]
Creates a
Sourcethat is materialized as an pekko.actor.ActorRef.Creates a
Sourcethat is materialized as an pekko.actor.ActorRef. Messages sent to this actor will be emitted to the stream if there is demand from downstream, and a new message will only be accepted after the previous messages has been consumed and acknowledged back. The stream will complete with failure if a message is sent before the acknowledgement has been replied back.The stream can be completed with failure by sending a message that is matched by
failureMatcher. The extracted java.lang.Throwable will be used to fail the stream. In case the Actor is still draining its internal buffer (after having received a message matched bycompletionMatcher) before signaling completion and it receives a message matched byfailureMatcher, the failure will be signaled downstream immediately (instead of the completion signal).The actor will be stopped when the stream is completed, failed or canceled from downstream, i.e. you can watch it to get notified when that happens.
- def apply[T](iterable: Iterable[T]): Source[T, NotUsed]
Helper to create Source from
Iterable.Helper to create Source from
Iterable. Example usage:Source(Seq(1,2,3))Starts a new
Sourcefrom the givenIterable. This is like starting from an Iterator, but every Subscriber directly attached to the Publisher of this stream will see an individual flow of elements (always starting from the beginning) regardless of when they subscribed. - final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def asSubscriber[T]: Source[T, Subscriber[T]]
Creates a
Sourcethat is materialized as a org.reactivestreams.Subscriber - def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- def combine[T, U, M](sources: Seq[Graph[SourceShape[T], M]])(fanInStrategy: (Int) => Graph[UniformFanInShape[T, U], NotUsed]): Source[U, Seq[M]]
Combines several sources with fan-in strategy like Merge or Concat into a single Source.
- def combine[T, U](first: Source[T, _], second: Source[T, _], rest: Source[T, _]*)(fanInStrategy: (Int) => Graph[UniformFanInShape[T, U], NotUsed]): Source[U, NotUsed]
Combines several sources with fan-in strategy like Merge or Concat into a single Source.
- def combineMat[T, U, M1, M2, M](first: Source[T, M1], second: Source[T, M2])(fanInStrategy: (Int) => Graph[UniformFanInShape[T, U], NotUsed])(matF: (M1, M2) => M): Source[U, M]
Combines several sources with fan-in strategy like Merge or Concat into a single Source with a materialized value.
- def completionStage[T](completionStage: CompletionStage[T]): Source[T, NotUsed]
Emits a single value when the given
CompletionStageis successfully completed and then completes the stream.Emits a single value when the given
CompletionStageis successfully completed and then completes the stream. If theCompletionStageis completed with a failure the stream is failed.Here for Java interoperability, the normal use from Scala should be Source.future
- def create[T](bufferSize: Int)(producer: (BoundedSourceQueue[T]) => Unit): Source[T, NotUsed]
Creates a Source that will immediately execute the provided function
producerwith a BoundedSourceQueue when materialized.Creates a Source that will immediately execute the provided function
producerwith a BoundedSourceQueue when materialized. This allows defining element production logic at Source creation time.The function
producercan push elements to the stream using the provided queue. The queue behaves the same as in Source.queue:
- Elements are emitted when there is downstream demand, buffered otherwise
- Elements are dropped if the buffer is full
- Buffered elements are discarded if downstream terminates
You should never block the producer thread, as it will block the stream from processing elements. If the functionproducerthrows an exception, the queue will be failed and the exception will be propagated to the stream.Example usage:
Source.create[Int](10) { queue => // This code is executed when the source is materialized queue.offer(1) queue.offer(2) queue.offer(3) queue.complete() }
- bufferSize
the size of the buffer (number of elements)
- producer
function that receives the queue and defines how to produce data
- returns
a Source that emits elements pushed to the queue
- Since
1.2.0
- def cycle[T](f: () => Iterator[T]): Source[T, NotUsed]
Creates Source that will continually produce given elements in specified order.
Creates Source that will continually produce given elements in specified order.
Starts a new 'cycled'
Sourcefrom the given elements. The producer stream of elements will continue infinitely by repeating the sequence of elements provided by function parameter. - def empty[T]: Source[T, NotUsed]
A
Sourcewith no elements, i.e.A
Sourcewith no elements, i.e. an empty stream that is completed immediately for every connectedSink. - final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def failed[T](cause: Throwable): Source[T, NotUsed]
Create a
Sourcethat immediately ends the stream with thecauseerror to every connectedSink. - def fromGraph[T, M](g: Graph[SourceShape[T], M]): Source[T, M]
A graph with the shape of a source logically is a source, this method makes it so also in type.
- def fromIterator[T](f: () => Iterator[T]): Source[T, NotUsed]
Helper to create Source from
Iterator.Helper to create Source from
Iterator. Example usage:Source.fromIterator(() => Iterator.from(0))Start a new
Sourcefrom the given function that produces an Iterator. The produced stream of elements will continue until the iterator runs empty or fails during evaluation of thenext()method. Elements are pulled out of the iterator in accordance with the demand coming from the downstream transformation steps. - def fromJavaStream[T, S <: BaseStream[T, S]](stream: () => BaseStream[T, S]): Source[T, NotUsed]
Creates a source that wraps a Java 8
.StreamCreates a source that wraps a Java 8
.Streamuses a stream iterator to get all its elements and send them downstream on demand.SourceYou can use Source.async to create asynchronous boundaries between synchronous Java
and the rest of flow.Stream - def fromMaterializer[T, M](factory: (Materializer, Attributes) => Source[T, M]): Source[T, Future[M]]
Defers the creation of a Source until materialization.
Defers the creation of a Source until materialization. The
factoryfunction exposes Materializer which is going to be used during materialization and Attributes of the Source returned by this method. - def fromPublisher[T](publisher: Publisher[T]): Source[T, NotUsed]
Helper to create Source from
Publisher.Helper to create Source from
Publisher.Construct a transformation starting with given publisher. The transformation steps are executed by a series of org.reactivestreams.Processor instances that mediate the flow of elements downstream and the propagation of back-pressure upstream.
- def future[T](futureElement: Future[T]): Source[T, NotUsed]
Emits a single value when the given
Futureis successfully completed and then completes the stream.Emits a single value when the given
Futureis successfully completed and then completes the stream. The stream fails if theFutureis completed with a failure. - def futureSource[T, M](futureSource: Future[Source[T, M]]): Source[T, Future[M]]
Turn a
Future[Source]into a source that will emit the values of the source when the future completes successfully.Turn a
Future[Source]into a source that will emit the values of the source when the future completes successfully. If theFutureis completed with a failure the stream is failed. - final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def iterate[T](seed: T)(p: (T) => Boolean, f: (T) => T): Source[T, NotUsed]
Creates a sequential
Sourceby iterating with the given predicate and function, starting with the givenseedvalue.Creates a sequential
Sourceby iterating with the given predicate and function, starting with the givenseedvalue. If the predicate returnsfalsefor the seed, theSourcecompletes with empty.- Since
1.1.0
- See also
- def lazyFuture[T](create: () => Future[T]): Source[T, NotUsed]
Defers invoking the
createfunction to create a future element until there is downstream demand.Defers invoking the
createfunction to create a future element until there is downstream demand.The returned future element will be emitted downstream when it completes, or fail the stream if the future is failed or the
createfunction itself fails.Note that asynchronous boundaries (and other operators) in the stream may do pre-fetching which counter acts the laziness and will trigger the factory immediately.
- def lazyFutureSource[T, M](create: () => Future[Source[T, M]]): Source[T, Future[M]]
Defers invoking the
createfunction to create a future source until there is downstream demand.Defers invoking the
createfunction to create a future source until there is downstream demand.The returned future source will emit downstream and behave just like it was the outer source when the future completes successfully. Downstream completes when the created source completes and fails when the created source fails. If the future or the
createfunction fails the stream is failed.Note that asynchronous boundaries (and other operators) in the stream may do pre-fetching which counter acts the laziness and triggers the factory immediately.
The materialized future value is completed with the materialized value of the created source when it has been materialized. If the function throws or the source materialization fails the future materialized value is failed with the thrown exception.
If downstream cancels or fails before the function is invoked the materialized value is failed with a pekko.stream.NeverMaterializedException
- def lazySingle[T](create: () => T): Source[T, NotUsed]
Defers invoking the
createfunction to create a single element until there is downstream demand.Defers invoking the
createfunction to create a single element until there is downstream demand.If the
createfunction fails when invoked the stream is failed.Note that asynchronous boundaries (and other operators) in the stream may do pre-fetching which counter acts the laziness and will trigger the factory immediately.
- def lazySource[T, M](create: () => Source[T, M]): Source[T, Future[M]]
Defers invoking the
createfunction to create a future source until there is downstream demand.Defers invoking the
createfunction to create a future source until there is downstream demand.The returned source will emit downstream and behave just like it was the outer source. Downstream completes when the created source completes and fails when the created source fails.
Note that asynchronous boundaries (and other operators) in the stream may do pre-fetching which counter acts the laziness and will trigger the factory immediately.
The materialized future value is completed with the materialized value of the created source when it has been materialized. If the function throws or the source materialization fails the future materialized value is failed with the thrown exception.
If downstream cancels or fails before the function is invoked the materialized value is failed with a pekko.stream.NeverMaterializedException
- def maybe[T]: Source[T, Promise[Option[T]]]
Create a
Sourcewhich materializes a scala.concurrent.Promise which controls what element will be emitted by the Source.Create a
Sourcewhich materializes a scala.concurrent.Promise which controls what element will be emitted by the Source. If the materialized promise is completed with a Some, that value will be produced downstream, followed by completion. If the materialized promise is completed with a None, no value will be produced downstream and completion will be signalled immediately. If the materialized promise is completed with a failure, then the source will fail with that error. If the downstream of this source cancels or fails before the promise has been completed, then the promise will be completed with None. - def mergePrioritizedN[T](sourcesAndPriorities: Seq[(Source[T, _], Int)], eagerComplete: Boolean): Source[T, NotUsed]
Merge multiple Sources.
Merge multiple Sources. Prefer the sources depending on the 'priority' parameters. The provided sources and priorities must have the same size and order.
emits when one of the inputs has an element available, preferring inputs based on the 'priority' parameters if both have elements available
backpressures when downstream backpressures
completes when both upstreams complete (This behavior is changeable to completing when any upstream completes by setting
eagerComplete=true.)Cancels when downstream cancels
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def never[T]: Source[T, NotUsed]
Never emits any elements, never completes and never fails.
Never emits any elements, never completes and never fails. This stream could be useful in tests.
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- def optionalVia[SOut, FOut, SMat, FMat, Mat](source: Source[Option[SOut], SMat], viaFlow: Flow[SOut, FOut, FMat])(combine: (SMat, FMat) => Mat): Source[Option[FOut], Mat]
Creates a Source from an existing base Source outputting an optional element and applying an additional viaFlow only if the element in the stream is defined.
Creates a Source from an existing base Source outputting an optional element and applying an additional viaFlow only if the element in the stream is defined.
Emits when the provided viaFlow runs with defined elements
Backpressures when the viaFlow runs for the defined elements and downstream backpressures
Completes when upstream completes
Cancels when downstream cancels
- source
The base source that outputs an optional element
- viaFlow
The flow that gets used if the optional element in is defined.
- combine
How to combine the materialized values of source and viaFlow
- returns
a Source with the viaFlow applied onto defined elements of the flow. The output value is contained within an Option which indicates whether the original source's element had viaFlow applied.
- Since
1.1.0
- def queue[T](bufferSize: Int, overflowStrategy: OverflowStrategy, maxConcurrentOffers: Int): Source[T, SourceQueueWithComplete[T]]
Creates a
Sourcethat is materialized as an pekko.stream.scaladsl.SourceQueueWithComplete.Creates a
Sourcethat is materialized as an pekko.stream.scaladsl.SourceQueueWithComplete. You can push elements to the queue and they will be emitted to the stream if there is demand from downstream, otherwise they will be buffered until request for demand is received. Elements in the buffer will be discarded if downstream is terminated.Depending on the defined pekko.stream.OverflowStrategy it might drop elements if there is no space available in the buffer.
Acknowledgement mechanism is available. pekko.stream.scaladsl.SourceQueueWithComplete.offer returns
Future[QueueOfferResult]which completes withQueueOfferResult.Enqueuedif element was added to buffer or sent downstream. It completes withQueueOfferResult.Droppedif element was dropped. Can also complete withQueueOfferResult.Failure- when stream failed orQueueOfferResult.QueueClosedwhen downstream is completed.The strategy pekko.stream.OverflowStrategy.backpressure will not complete
maxConcurrentOffersnumber ofoffer():Futurecall when buffer is full.To drop the newest elements, it's recommended combining with
Source.queue(bufferSize)which returns a QueueOfferResult synchronously.You can watch accessibility of stream with pekko.stream.scaladsl.SourceQueueWithComplete.watchCompletion. It returns future that completes with success when the operator is completed or fails when the stream is failed.
The buffer can be disabled by using
bufferSizeof 0 and then received message will wait for downstream demand unless there is another message waiting for downstream demand, in that case offer result will be completed according to the overflow strategy.The materialized SourceQueue may be used by up to maxConcurrentOffers concurrent producers.
- bufferSize
size of buffer in element count
- overflowStrategy
Strategy that is used when incoming elements cannot fit inside the buffer
- maxConcurrentOffers
maximum number of pending offers when buffer is full, should be greater than 0.
- def queue[T](bufferSize: Int, overflowStrategy: OverflowStrategy): Source[T, SourceQueueWithComplete[T]]
Creates a
Sourcethat is materialized as an pekko.stream.scaladsl.SourceQueueWithComplete.Creates a
Sourcethat is materialized as an pekko.stream.scaladsl.SourceQueueWithComplete. You can push elements to the queue and they will be emitted to the stream if there is demand from downstream, otherwise they will be buffered until request for demand is received. Elements in the buffer will be discarded if downstream is terminated.Depending on the defined pekko.stream.OverflowStrategy it might drop elements if there is no space available in the buffer.
Acknowledgement mechanism is available. pekko.stream.scaladsl.SourceQueueWithComplete.offer returns
Future[QueueOfferResult]which completes withQueueOfferResult.Enqueuedif element was added to buffer or sent downstream. It completes withQueueOfferResult.Droppedif element was dropped. Can also complete withQueueOfferResult.Failure- when stream failed orQueueOfferResult.QueueClosedwhen downstream is completed.The strategy pekko.stream.OverflowStrategy.backpressure will not complete last
offer():Futurecall when buffer is full.To drop the newest elements, it's recommended combining with
Source.queue(bufferSize)which returns a QueueOfferResult synchronously.You can watch accessibility of stream with pekko.stream.scaladsl.SourceQueueWithComplete.watchCompletion. It returns future that completes with success when the operator is completed or fails when the stream is failed.
The buffer can be disabled by using
bufferSizeof 0 and then received message will wait for downstream demand unless there is another message waiting for downstream demand, in that case offer result will be completed according to the overflow strategy.The materialized SourceQueue may only be used from a single producer.
- bufferSize
size of buffer in element count
- overflowStrategy
Strategy that is used when incoming elements cannot fit inside the buffer
- def queue[T](bufferSize: Int): Source[T, BoundedSourceQueue[T]]
Creates a
Sourcethat is materialized as an pekko.stream.BoundedSourceQueue.Creates a
Sourcethat is materialized as an pekko.stream.BoundedSourceQueue. You can push elements to the queue and they will be emitted to the stream if there is demand from downstream, otherwise they will be buffered until request for demand is received. The buffer size is passed in as a parameter. Elements in the buffer will be discarded if downstream is terminated.Pushed elements may be dropped if there is no space available in the buffer. Elements will also be dropped if the queue is failed through the materialized
BoundedQueueSourceor theSourceis cancelled by the downstream. An element that was reported to beenqueuedis not guaranteed to be processed by the rest of the stream. If the queue is failed by callingBoundedQueueSource.failor the downstream cancels the stream, elements in the buffer are discarded.Acknowledgement of pushed elements is immediate. pekko.stream.BoundedSourceQueue.offer returns pekko.stream.QueueOfferResult which is implemented as:
QueueOfferResult.Enqueuedelement was added to buffer, but may still be discarded later when the queue is failed or cancelledQueueOfferResult.Droppedelement was droppedQueueOfferResult.QueueCompletethe queue was completed with pekko.stream.BoundedSourceQueue.completeQueueOfferResult.Failurethe queue was failed with pekko.stream.BoundedSourceQueue.fail or if the stream failed- bufferSize
size of the buffer in number of elements
- def repeat[T](element: T): Source[T, NotUsed]
Create a
Sourcethat will continually emit the given element. - def shape[T](name: String): SourceShape[T]
INTERNAL API
- def single[T](element: T): Source[T, NotUsed]
Create a
Sourcewith one element.Create a
Sourcewith one element. Every connectedSinkof this stream will see an individual stream consisting of one element. - final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def tick[T](initialDelay: FiniteDuration, interval: FiniteDuration, tick: T): Source[T, Cancellable]
Elements are emitted periodically with the specified interval.
Elements are emitted periodically with the specified interval. The tick element will be delivered to downstream consumers that has requested any elements. If a consumer has not requested any elements at the point in time when the tick element is produced it will not receive that tick element later. It will receive new tick elements as soon as it has requested more elements.
- def toString(): String
- Definition Classes
- AnyRef → Any
- def unfold[S, E](s: S)(f: (S) => Option[(S, E)]): Source[E, NotUsed]
Create a
Sourcethat will unfold a value of typeSinto a pair of the next stateSand output elements of typeE.Create a
Sourcethat will unfold a value of typeSinto a pair of the next stateSand output elements of typeE.For example, all the Fibonacci numbers under 10M:
Source.unfold(0 -> 1) { case (a, _) if a > 10000000 => None case (a, b) => Some((b -> (a + b)) -> a) }
- def unfoldAsync[S, E](s: S)(f: (S) => Future[Option[(S, E)]]): Source[E, NotUsed]
Same as unfold, but uses an async function to generate the next state-element tuple.
Same as unfold, but uses an async function to generate the next state-element tuple.
async fibonacci example:
Source.unfoldAsync(0 -> 1) { case (a, _) if a > 10000000 => Future.successful(None) case (a, b) => Future{ Thread.sleep(1000) Some((b -> (a + b)) -> a) } }
- def unfoldResource[T, R](create: () => R, read: (R) => Option[T], close: (R) => Unit): Source[T, NotUsed]
Start a new
Sourcefrom some resource which can be opened, read and closed.Start a new
Sourcefrom some resource which can be opened, read and closed. Interaction with resource happens in a blocking way.Example:
Source.unfoldResource( () => new BufferedReader(new FileReader("...")), reader => Option(reader.readLine()), reader => reader.close())
You can use the supervision strategy to handle exceptions for
readfunction. All exceptions thrown bycreateorclosewill fail the stream.Restartsupervision strategy will close and create blocking IO again. Default strategy isStopwhich means that stream will be terminated on error inreadfunction by default.You can configure the default dispatcher for this Source by changing the
pekko.stream.materializer.blocking-io-dispatcheror set it for a given Source by using ActorAttributes.Adheres to the ActorAttributes.SupervisionStrategy attribute.
- T
- the element type
- R
- the resource type.
- create
- function that is called on stream start and creates/opens resource.
- read
- function that reads data from opened resource. It is called each time backpressure signal is received. Stream calls close and completes when
readreturns None.- close
- function that closes resource
- def unfoldResourceAsync[T, R](create: () => Future[R], read: (R) => Future[Option[T]], close: (R) => Future[Done]): Source[T, NotUsed]
Start a new
Sourcefrom some resource which can be opened, read and closed.Start a new
Sourcefrom some resource which can be opened, read and closed. It's similar tounfoldResourcebut takes functions that returnFuturesinstead of plain values.You can use the supervision strategy to handle exceptions for
readfunction or failures of producedFutures. All exceptions thrown bycreateorcloseas well as fails of returned futures will fail the stream.Restartsupervision strategy will close and create resource. Default strategy isStopwhich means that stream will be terminated on error inreadfunction (or future) by default.You can configure the default dispatcher for this Source by changing the
pekko.stream.materializer.blocking-io-dispatcheror set it for a given Source by using ActorAttributes.Adheres to the ActorAttributes.SupervisionStrategy attribute.
- T
the element type
- R
the resource type
- create
- function that is called on stream start and creates/opens resource.
- read
- function that reads data from opened resource. It is called each time backpressure signal is received. Stream calls close and completes when
Futurefrom read function returns None.- close
- function that closes resource
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def zipN[T](sources: Seq[Source[T, _]]): Source[Seq[T], NotUsed]
Combine the elements of multiple streams into a stream of sequences.
- def zipWithN[T, O](zipper: (Seq[T]) => O)(sources: Seq[Source[T, _]]): Source[O, NotUsed]
Combine the elements of multiple streams into a stream of sequences using a combiner function.