fix the build on main (#31251)

* Fix compilation on scala 2.12

* Add mergePrioritizedN to docs

* Format Java code
This commit is contained in:
Arnout Engelen 2022-03-17 14:44:38 +01:00 committed by GitHub
parent fccb0ca220
commit 332f18c42b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 55 additions and 55 deletions

View file

@ -208,10 +208,8 @@ class SourceOrFlow {
Source<Integer, NotUsed> sourceA = Source.from(Arrays.asList(1, 2, 3, 4));
Source<Integer, NotUsed> sourceB = Source.from(Arrays.asList(10, 20, 30, 40));
Source<Integer, NotUsed> sourceC = Source.from(Arrays.asList(100, 200, 300, 400));
List<Pair<Source<Integer, ?>,Integer>> sourcesAndPriorities = Arrays.asList(
new Pair<>(sourceA, 9900),
new Pair<>(sourceB, 99),
new Pair<>(sourceC, 1));
List<Pair<Source<Integer, ?>, Integer>> sourcesAndPriorities =
Arrays.asList(new Pair<>(sourceA, 9900), new Pair<>(sourceB, 99), new Pair<>(sourceC, 1));
Source.mergePrioritizedN(sourcesAndPriorities, false).runForeach(System.out::println, system);
// prints e.g. 1, 100, 2, 3, 4, 10, 20, 30, 40, 200, 300, 400 since both sources have their
// first element ready and