1
反応性のあるストリームを学習し、次のように2つのFluxを組み合わせようとしています。2つのFluxをzipWithを組み合わせて使用するとエラーが発生する
List<Integer> elems = new ArrayList<>();
Flux.just(10,20,30,40)
.log()
.map(x -> x * 2)
.zipWith(Flux.range(0, Integer.MAX_VALUE),
(two, one) -> String.format("First : %d, Second : %d \n", one, two))
.subscribe(elems::add);
と購読呼び出すときに、私は次のエラーました:
Multiple markers at this line
- The method subscribe(Consumer<? super String>) in the type Flux<String> is not applicable for the arguments
(elems::add)
- The type List<Integer> does not define add(String) that is applicable here
をし、私は問題を解決するには、次の提案を得た:
しかし、これらの代替のどれを働いた。 提案、どのようにこの問題を解決するには?