Last active
June 8, 2017 16:43
-
-
Save smaldini/d407cc9f9a1d13bbde6dcd93166df8c7 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
Flux<Integer> intFlux = Flux.range(1, 1000) | |
//2 | |
//old: test=baseSubscriber | |
//next: test=baseSubscriber_range | |
.contextualize((old, next) -> next.put("test", old.get("test") + "_range")) | |
.flatMap(d -> Flux.just(d) | |
//4 (x1000) | |
//old: test=baseSubscriber_range | |
//next: test=baseSubscriber_range_innerFlatmap | |
.contextualize((old, next) -> next.put("test", old.get("test") + "_innerFlatmap"))) | |
.map(d -> d) | |
.distinct() | |
//3 | |
//old: test=baseSubscriber_range | |
//next: test=baseSubscriber_range_distinct | |
.contextualize((old, next) -> next.put("test", old.get("test") + "_distinct")) | |
.subscribe(new BaseSubscriber<Integer>() { | |
//1 | |
//old: [empty] | |
//next: test=baseSubscriber | |
@Override | |
public Context pullContext() { | |
return Context.empty() | |
.put("test", "baseSubscriber"); | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment