remove Future from StreamRefs mat val, #24372 (#26847)

This commit is contained in:
Patrik Nordwall 2019-05-02 16:54:37 +02:00 committed by GitHub
parent 1128024797
commit 82c761f026
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 109 additions and 117 deletions

View file

@ -55,10 +55,9 @@ public class FlowStreamRefsDocTest extends AbstractJavaTest {
private void handleRequestLogs(RequestLogs requestLogs) {
Source<String, NotUsed> logs = streamLogs(requestLogs.streamId);
CompletionStage<SourceRef<String>> logsRef = logs.runWith(StreamRefs.sourceRef(), mat);
SourceRef<String> logsRef = logs.runWith(StreamRefs.sourceRef(), mat);
Patterns.pipe(logsRef.thenApply(ref -> new LogsOffer(ref)), context().dispatcher())
.to(sender());
getSender().tell(new LogsOffer(logsRef), getSelf());
}
private Source<String, NotUsed> streamLogs(long streamId) {
@ -111,13 +110,9 @@ public class FlowStreamRefsDocTest extends AbstractJavaTest {
PrepareUpload.class,
prepare -> {
Sink<String, NotUsed> sink = logsSinkFor(prepare.id);
CompletionStage<SinkRef<String>> sinkRef =
StreamRefs.<String>sinkRef().to(sink).run(mat);
SinkRef<String> sinkRef = StreamRefs.<String>sinkRef().to(sink).run(mat);
Patterns.pipe(
sinkRef.thenApply(ref -> new MeasurementsSinkReady(prepare.id, ref)),
context().dispatcher())
.to(sender());
getSender().tell(new MeasurementsSinkReady(prepare.id, sinkRef), getSelf());
})
.build();
}