add Source.never (#29008)
* add Source.never * make Source.never single instance, add DefaultAttributes
This commit is contained in:
parent
b2509efdb0
commit
2104849658
7 changed files with 80 additions and 0 deletions
|
|
@ -304,6 +304,13 @@ object Source {
|
|||
def future[T](futureElement: Future[T]): Source[T, NotUsed] =
|
||||
scaladsl.Source.future(futureElement).asJava
|
||||
|
||||
/**
|
||||
* Never emits any elements, never completes and never fails.
|
||||
* This stream could be useful in tests.
|
||||
*/
|
||||
def never[T]: Source[T, NotUsed] =
|
||||
scaladsl.Source.never.asJava
|
||||
|
||||
/**
|
||||
* Emits a single value when the given `CompletionStage` is successfully completed and then completes the stream.
|
||||
* If the `CompletionStage` is completed with a failure the stream is failed.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue