rename akka-docs dir to docs (#62)
This commit is contained in:
parent
13dce0ec69
commit
708da8caec
1029 changed files with 2033 additions and 2039 deletions
40
docs/src/test/java/jdocs/stream/SinkRecipeDocTest.java
Normal file
40
docs/src/test/java/jdocs/stream/SinkRecipeDocTest.java
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (C) 2018-2022 Lightbend Inc. <https://www.lightbend.com>
|
||||
*/
|
||||
|
||||
package jdocs.stream;
|
||||
|
||||
import org.apache.pekko.NotUsed;
|
||||
import org.apache.pekko.actor.ActorSystem;
|
||||
import org.apache.pekko.japi.function.Function;
|
||||
import org.apache.pekko.stream.javadsl.Source;
|
||||
import org.apache.pekko.stream.javadsl.Sink;
|
||||
import jdocs.AbstractJavaTest;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.CompletionStage;
|
||||
|
||||
public class SinkRecipeDocTest extends AbstractJavaTest {
|
||||
static ActorSystem system;
|
||||
|
||||
@BeforeClass
|
||||
public static void setup() {
|
||||
system = ActorSystem.create("SinkRecipeDocTest");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void foreachAsync() {
|
||||
final Function<Integer, CompletionStage<Void>> asyncProcessing =
|
||||
param -> CompletableFuture.completedFuture(param).thenAccept(System.out::println);
|
||||
|
||||
// #forseachAsync-processing
|
||||
// final Function<Integer, CompletionStage<Void>> asyncProcessing = _
|
||||
|
||||
final Source<Integer, NotUsed> numberSource = Source.range(1, 100);
|
||||
|
||||
numberSource.runWith(Sink.foreachAsync(10, asyncProcessing), system);
|
||||
// #forseachAsync-processing
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue