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
|
|
@ -32,19 +32,16 @@ import static org.junit.Assert.assertArrayEquals;
|
|||
public class BidiFlowDocTest extends AbstractJavaTest {
|
||||
|
||||
static ActorSystem system;
|
||||
static Materializer mat;
|
||||
|
||||
@BeforeClass
|
||||
public static void setup() {
|
||||
system = ActorSystem.create("FlowDocTest");
|
||||
mat = ActorMaterializer.create(system);
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void tearDown() {
|
||||
TestKit.shutdownActorSystem(system);
|
||||
system = null;
|
||||
mat = null;
|
||||
}
|
||||
|
||||
// #codec
|
||||
|
|
@ -261,7 +258,7 @@ public class BidiFlowDocTest extends AbstractJavaTest {
|
|||
.<Message>map(id -> new Ping(id))
|
||||
.via(flow)
|
||||
.grouped(10)
|
||||
.runWith(Sink.<List<Message>>head(), mat);
|
||||
.runWith(Sink.<List<Message>>head(), system);
|
||||
assertArrayEquals(
|
||||
new Message[] {new Pong(0), new Pong(1), new Pong(2)},
|
||||
result.toCompletableFuture().get(1, TimeUnit.SECONDS).toArray(new Message[0]));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue