clean up dependencies #19755 and other fixes
* remove inter-project dependencies between streamTestkit -> peristence -> remote * make PartitionOutOfBoundsException extend IndexOutOfBoundsException * some weird formatting * remove -experimental from HTTP Testkit/Tests * split out shared LevelDb journal tests into new subproject (not to be published)
This commit is contained in:
parent
10d3af1478
commit
e202ea8c40
18 changed files with 288 additions and 218 deletions
|
|
@ -138,37 +138,37 @@ class SubSource[+Out, +Mat](delegate: scaladsl.SubFlow[Out, Mat, scaladsl.Source
|
|||
* '''Cancels when''' downstream cancels
|
||||
*/
|
||||
def mapConcat[T](f: function.Function[Out, java.lang.Iterable[T]]): SubSource[T, Mat] =
|
||||
new SubSource(delegate.statefulMapConcat { () ⇒ elem ⇒ Util.immutableSeq(f(elem)) })
|
||||
new SubSource(delegate.mapConcat { elem ⇒ Util.immutableSeq(f(elem)) })
|
||||
|
||||
/**
|
||||
* Transform each input element into an `Iterable` of output elements that is
|
||||
* then flattened into the output stream. The transformation is meant to be stateful,
|
||||
* which is enabled by creating the transformation function anew for every materialization —
|
||||
* the returned function will typically close over mutable objects to store state between
|
||||
* invocations. For the stateless variant see [[#mapConcat]].
|
||||
*
|
||||
* Make sure that the `Iterable` is immutable or at least not modified after
|
||||
* being used as an output sequence. Otherwise the stream may fail with
|
||||
* `ConcurrentModificationException` or other more subtle errors may occur.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
def statefulMapConcat[T](f: function.Creator[function.Function[Out, java.lang.Iterable[T]]]):SubSource[T, Mat] =
|
||||
new SubSource(delegate.statefulMapConcat{ () ⇒ {
|
||||
* Transform each input element into an `Iterable` of output elements that is
|
||||
* then flattened into the output stream. The transformation is meant to be stateful,
|
||||
* which is enabled by creating the transformation function anew for every materialization —
|
||||
* the returned function will typically close over mutable objects to store state between
|
||||
* invocations. For the stateless variant see [[#mapConcat]].
|
||||
*
|
||||
* Make sure that the `Iterable` is immutable or at least not modified after
|
||||
* being used as an output sequence. Otherwise the stream may fail with
|
||||
* `ConcurrentModificationException` or other more subtle errors may occur.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
def statefulMapConcat[T](f: function.Creator[function.Function[Out, java.lang.Iterable[T]]]): SubSource[T, Mat] =
|
||||
new SubSource(delegate.statefulMapConcat { () ⇒
|
||||
val fun = f.create()
|
||||
elem ⇒ Util.immutableSeq(fun(elem))
|
||||
}})
|
||||
})
|
||||
|
||||
/**
|
||||
* Transform this stream by applying the given function to each of the elements
|
||||
|
|
@ -612,23 +612,23 @@ class SubSource[+Out, +Mat](delegate: scaladsl.SubFlow[Out, Mat, scaladsl.Source
|
|||
new SubSource(delegate.recover(pf))
|
||||
|
||||
/**
|
||||
* RecoverWith allows to switch to alternative Source on flow failure. It will stay in effect after
|
||||
* a failure has been recovered so that each time there is a failure it is fed into the `pf` and a new
|
||||
* Source may be materialized.
|
||||
*
|
||||
* 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 element is available
|
||||
* from alternative Source
|
||||
*
|
||||
* '''Backpressures when''' downstream backpressures
|
||||
*
|
||||
* '''Completes when''' upstream completes or upstream failed with exception pf can handle
|
||||
*
|
||||
* '''Cancels when''' downstream cancels
|
||||
*
|
||||
*/
|
||||
* RecoverWith allows to switch to alternative Source on flow failure. It will stay in effect after
|
||||
* a failure has been recovered so that each time there is a failure it is fed into the `pf` and a new
|
||||
* Source may be materialized.
|
||||
*
|
||||
* 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 element is available
|
||||
* from alternative Source
|
||||
*
|
||||
* '''Backpressures when''' downstream backpressures
|
||||
*
|
||||
* '''Completes when''' upstream completes or upstream failed with exception pf can handle
|
||||
*
|
||||
* '''Cancels when''' downstream cancels
|
||||
*
|
||||
*/
|
||||
def recoverWith[T >: Out](pf: PartialFunction[Throwable, _ <: Graph[SourceShape[T], NotUsed]]): SubSource[T, Mat @uncheckedVariance] =
|
||||
new SubSource(delegate.recoverWith(pf))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue