-
Notifications
You must be signed in to change notification settings - Fork 135
What does SimpleReact do?
johnmcclean-aol edited this page Feb 4, 2015
·
2 revisions
SimpleReact allows you to easily construct highly concurrent, asynchronous, event-driven dataflows with a simple fluent Api. They are constructed under the hood from JDK 8 Streams of JDK 8 CompletableFutures where tasks are lambda's built with JDK 8 functional interfaces.
SimpleReact sets up multiple threads that move independently through user defined steps (using commands such as then, onFail, merge, peek, filter or capture). You can visualise it as something like this :-
The code to do that could look something like this :-
new SimpleReact().react(() -> makeRestCall(serviceA), () -> makeRestCall(serviceB),
makeRestCall(serviceC))
.then( restResult -> convertToGreenSquare(restResult))
.then( GreenSquare input -> convertToOrangeCircle(input))
.then( OrangeCircle input -> convertToYellowTriangle(input))
.block(Collectors.toSet())
oops - my bad