'git mv' rst resources to md
This is mainly intended to keep the git history as neat as possible. No actual conversion yet, so now both the rst and the paradox docs are broken, which will be fixed in the next commits.
This commit is contained in:
parent
5507147073
commit
a4a0d308ad
553 changed files with 0 additions and 0 deletions
|
|
@ -0,0 +1,38 @@
|
|||
/**
|
||||
* Copyright (C) 2015-2017 Lightbend Inc. <http://www.lightbend.com>
|
||||
*/
|
||||
package jdocs.stream;
|
||||
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import akka.NotUsed;
|
||||
import akka.japi.Pair;
|
||||
import akka.stream.javadsl.*;
|
||||
//#asPublisher-import
|
||||
import static akka.stream.javadsl.AsPublisher.*;
|
||||
//#asPublisher-import
|
||||
|
||||
public class MigrationsJava {
|
||||
|
||||
public static void main(String[] args) {
|
||||
//#expand-continually
|
||||
Flow.of(Integer.class).expand(in -> Stream.iterate(in, i -> i).iterator());
|
||||
//#expand-continually
|
||||
//#expand-state
|
||||
Flow.of(Integer.class).expand(in ->
|
||||
Stream.iterate(new Pair<>(in, 0),
|
||||
p -> new Pair<>(in, p.second() + 1)).iterator());
|
||||
//#expand-state
|
||||
|
||||
//#asPublisher
|
||||
Sink.asPublisher(WITH_FANOUT); // instead of Sink.asPublisher(true)
|
||||
Sink.asPublisher(WITHOUT_FANOUT); // instead of Sink.asPublisher(false)
|
||||
//#asPublisher
|
||||
|
||||
//#async
|
||||
Flow<Integer, Integer, NotUsed> flow = Flow.of(Integer.class).map(n -> n + 1);
|
||||
Source.range(1, 10).via(flow.async());
|
||||
//#async
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue