From 0a12885e2a12e75b86e0da4ee749b2c46e35ae0a Mon Sep 17 00:00:00 2001 From: Andrei Arlou Date: Tue, 10 May 2022 13:35:30 +0300 Subject: [PATCH] Add missed apidoc links in stream/stream-quickstart.md (#22904) (#31391) --- akka-docs/src/main/paradox/stream/stream-quickstart.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/akka-docs/src/main/paradox/stream/stream-quickstart.md b/akka-docs/src/main/paradox/stream/stream-quickstart.md index e1576680ba..be7c9add3c 100644 --- a/akka-docs/src/main/paradox/stream/stream-quickstart.md +++ b/akka-docs/src/main/paradox/stream/stream-quickstart.md @@ -408,20 +408,20 @@ prepared Sink using `toMat`]@java[`Sink.fold` will sum all `Integer` elements of a `CompletionStage`. Next we use the `map` method of `tweets` `Source` which will change each incoming tweet into an integer value `1`. Finally we connect the Flow to the previously prepared Sink using `toMat`]. -Remember those mysterious `Mat` type parameters on @scala[`Source[+Out, +Mat]`, `Flow[-In, +Out, +Mat]` and `Sink[-In, +Mat]`]@java[`Source`, `Flow` and `Sink`]? +Remember those mysterious `Mat` type parameters on @scala[@scaladoc[Source](akka.stream.scaladsl.Source)\[+Out, +Mat\], @scaladoc[Flow](akka.stream.scaladsl.Flow)\[-In, +Out, +Mat\] and @scaladoc[Sink](akka.stream.scaladsl.Sink)\[-In, +Mat\]]@java[@javadoc[Source](akka.stream.javadsl.Source), @javadoc[Flow](akka.stream.javadsl.Flow) and @javadoc[Sink](akka.stream.javadsl.Sink)]? They represent the type of values these processing parts return when materialized. When you chain these together, -you can explicitly combine their materialized values. In our example we used the @scala[`Keep.right`]@java[`Keep.right()`] predefined function, +you can explicitly combine their materialized values. In our example we used the @scala[@scaladoc[Keep.right](akka.stream.scaladsl.Keep$#right[L,R]:(L,R)=%3ER)]@java[@javadoc[Keep.right()](akka.stream.javadsl.Keep$#right())] predefined function, which tells the implementation to only care about the materialized type of the operator currently appended to the right. -The materialized type of `sumSink` is @scala[`Future[Int]`]@java[`CompletionStage`] and because of using @scala[`Keep.right`]@java[`Keep.right()`], the resulting `RunnableGraph` +The materialized type of `sumSink` is @scala[@scaladoc[Future](scala.concurrent.Future)\[Int\]]@java[@javadoc[CompletionStage](java.util.concurrent.CompletionStage)] and because of using @scala[`Keep.right`]@java[`Keep.right()`], the resulting @apidoc[akka.stream.*.RunnableGraph] has also a type parameter of @scala[`Future[Int]`]@java[`CompletionStage`]. This step does *not* yet materialize the processing pipeline, it merely prepares the description of the Flow, which is now connected to a Sink, and therefore can -be `run()`, as indicated by its type: @scala[`RunnableGraph[Future[Int]]`]@java[`RunnableGraph>`]. Next we call `run()` which materializes and runs the Flow. The value returned by calling `run()` on a @scala[`RunnableGraph[T]`]@java[`RunnableGraph`] is of type `T`. +be `run()`, as indicated by its type: @scala[`RunnableGraph[Future[Int]]`]@java[`RunnableGraph>`]. Next we call @apidoc[run()](akka.stream.*.RunnableGraph) {scala="#run()(implicitmaterializer:akka.stream.Materializer):Mat" java="#run(akka.stream.Materializer)"} which materializes and runs the Flow. The value returned by calling `run()` on a @scala[`RunnableGraph[T]`]@java[`RunnableGraph`] is of type `T`. In our case this type is @scala[`Future[Int]`]@java[`CompletionStage`] which, when completed, will contain the total length of our `tweets` stream. In case of the stream failing, this future would complete with a Failure. -A `RunnableGraph` may be reused +A @apidoc[akka.stream.*.RunnableGraph] may be reused and materialized multiple times, because it is only the "blueprint" of the stream. This means that if we materialize a stream, for example one that consumes a live stream of tweets within a minute, the materialized values for those two materializations will be different, as illustrated by this example: