use of com.oath.cyclops.types.futurestream.SimpleReactStream in project cyclops by aol.
the class TakeSkipSliceTest method testZipWithFutures.
@Test
public void testZipWithFutures() {
SimpleReactStream stream = of("a", "b");
List<Tuple2<Integer, String>> result = of(1, 2).zip(stream).block();
assertThat(result.size(), is(asList(tuple(1, "a"), tuple(2, "b")).size()));
}
use of com.oath.cyclops.types.futurestream.SimpleReactStream in project cyclops by aol.
the class BlockingTest method testFirstSimple.
@Test
public void testFirstSimple() throws InterruptedException, ExecutionException {
SimpleReactStream<Integer> stage = new SimpleReact().<Integer>ofAsync(() -> 1, () -> 2, () -> 3, () -> 5).then(it -> it * 100).then(it -> sleep(it));
int result = stage.block().firstValue(null);
assertThat(result, is(100));
stage.block();
}
Aggregations