Skip to content

FutureW

johnmcclean-aol edited this page Nov 21, 2016 · 7 revisions

FutureW(rapper)

Why?

CompletableFuture has a non-standard API, FutureW provides a more standard API with all of cyclops-react advanced features.

Stream

Stream

Optional

Optional

### CompletableFuture

CompletableFuture

FutureW

FutureW)

Features

Quorum support

FutureW<Integer> one = FutureW.ofSupplier(()->1);
FutureW<Integer> two = FutureW.ofSupplier(()->2);
FutureW<Integer> three = FutureW.future(); //started but not complete
FutureW<ListX<Integer>> strings = FutureW.quorum(status -> status.getCompleted() > 1,
                                                   ,one,two,three);
               

assertThat(strings.get().size(), is(greaterThan(1)));
Clone this wiki locally