System wide materializer (#27491)
Introduces a materializer started through an extension and then an implicit conversion for Scala turning an implicitly available ActorSystem into a materializer. The Java APIs has been ammended with run-methods accepting an ActorSystem.
This commit is contained in:
parent
77d1d33dbc
commit
45c826a218
196 changed files with 1148 additions and 1129 deletions
|
|
@ -7,8 +7,6 @@ package jdocs.stream;
|
|||
import akka.NotUsed;
|
||||
import akka.actor.ActorSystem;
|
||||
import akka.japi.function.Function;
|
||||
import akka.stream.ActorMaterializer;
|
||||
import akka.stream.Materializer;
|
||||
import akka.stream.javadsl.Source;
|
||||
import akka.stream.javadsl.Sink;
|
||||
import jdocs.AbstractJavaTest;
|
||||
|
|
@ -20,12 +18,10 @@ import java.util.concurrent.CompletionStage;
|
|||
|
||||
public class SinkRecipeDocTest extends AbstractJavaTest {
|
||||
static ActorSystem system;
|
||||
static Materializer mat;
|
||||
|
||||
@BeforeClass
|
||||
public static void setup() {
|
||||
system = ActorSystem.create("SinkRecipeDocTest");
|
||||
mat = ActorMaterializer.create(system);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -38,7 +34,7 @@ public class SinkRecipeDocTest extends AbstractJavaTest {
|
|||
|
||||
final Source<Integer, NotUsed> numberSource = Source.range(1, 100);
|
||||
|
||||
numberSource.runWith(Sink.foreachAsync(10, asyncProcessing), mat);
|
||||
numberSource.runWith(Sink.foreachAsync(10, asyncProcessing), system);
|
||||
// #forseachAsync-processing
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue