Created
March 20, 2020 13:47
-
-
Save danielkec/bb29f12019c4d5e61f3fea094b38edb1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AtomicInteger sum = new AtomicInteger(); | |
ReactiveStreams.of("1", "2", "3", "4", "5") | |
.limit(3) | |
.map(Integer::parseInt) | |
.forEach(sum::addAndGet) | |
.run() | |
.whenComplete((r, t) -> System.out.println("Sum: " + sum.get())); | |
> Sum: 6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment