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
|
|
@ -4,6 +4,8 @@ Complete right away without ever emitting any elements.
|
|||
|
||||
@ref[Source operators](../index.md#source-operators)
|
||||
|
||||
@ref:[`Source.never`](never.md) a source which emits nothing and never completes.
|
||||
|
||||
## Signature
|
||||
|
||||
@apidoc[Source.empty](Source$) { scala="#empty[T]:akka.stream.scaladsl.Source[T,akka.NotUsed]" java="#empty()" java="#empty(java.lang.Class)" }
|
||||
|
|
|
|||
27
akka-docs/src/main/paradox/stream/operators/Source/never.md
Normal file
27
akka-docs/src/main/paradox/stream/operators/Source/never.md
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
# never
|
||||
|
||||
Never emit any elements, never complete and never fail.
|
||||
|
||||
@ref[Source operators](../index.md#source-operators)
|
||||
|
||||
@ref:[`Source.empty`](empty.md), a source which emits nothing and completes immediately.
|
||||
|
||||
## Signature
|
||||
|
||||
@@signature [Source.scala](/akka-stream/src/main/scala/akka/stream/scaladsl/Source.scala) { #never }
|
||||
|
||||
@@@
|
||||
|
||||
## Description
|
||||
|
||||
Create a source which never emits any elements, never completes and never failes. Useful for tests.
|
||||
|
||||
## Reactive Streams semantics
|
||||
|
||||
@@@div { .callout }
|
||||
|
||||
**emits** never
|
||||
|
||||
**completes** never
|
||||
|
||||
@@@
|
||||
|
|
@ -36,6 +36,7 @@ These built-in sources are available from @scala[`akka.stream.scaladsl.Source`]
|
|||
|Source|<a name="lazysingle"></a>@ref[lazySingle](Source/lazySingle.md)|Defers creation of a single element source until there is demand.|
|
||||
|Source|<a name="lazysource"></a>@ref[lazySource](Source/lazySource.md)|Defers creation and materialization of a `Source` until there is demand.|
|
||||
|Source|<a name="maybe"></a>@ref[maybe](Source/maybe.md)|Create a source that emits once the materialized @scala[`Promise`] @java[`CompletableFuture`] is completed with a value.|
|
||||
|Source|<a name="never"></a>@ref[never](Source/never.md)|Never emit any elements, never complete and never fail.|
|
||||
|Source|<a name="queue"></a>@ref[queue](Source/queue.md)|Materialize a `SourceQueue` onto which elements can be pushed for emitting from the source. |
|
||||
|Source|<a name="range"></a>@ref[range](Source/range.md)|Emit each integer in a range, with an option to take bigger steps than 1.|
|
||||
|Source|<a name="repeat"></a>@ref[repeat](Source/repeat.md)|Stream a single object repeatedly.|
|
||||
|
|
@ -484,6 +485,7 @@ For more background see the @ref[Error Handling in Streams](../stream-error.md)
|
|||
* [mergePrioritized](Source-or-Flow/mergePrioritized.md)
|
||||
* [mergeSorted](Source-or-Flow/mergeSorted.md)
|
||||
* [monitor](Source-or-Flow/monitor.md)
|
||||
* [never](Source/never.md)
|
||||
* [onComplete](Sink/onComplete.md)
|
||||
* [onFailuresWithBackoff](RestartSource/onFailuresWithBackoff.md)
|
||||
* [onFailuresWithBackoff](RestartFlow/onFailuresWithBackoff.md)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue