use of com.oath.cyclops.types.futurestream.BaseSimpleReactStream in project cyclops by aol.
the class SimpleReactTest method streamParallelOf.
@Test
public void streamParallelOf() {
BaseSimpleReactStream value = BaseSimpleReactStream.parallel(1, 2);
assertThat(value.getTaskExecutor(), is(ForkJoinPool.commonPool()));
}
use of com.oath.cyclops.types.futurestream.BaseSimpleReactStream in project cyclops by aol.
the class SimpleReactTest method testSeparatedChains.
@Test
public void testSeparatedChains() {
// .split(2);
BaseSimpleReactStream<String> orgBuilder = new SimpleReact().ofAsync(() -> "Hello", () -> "World");
BaseSimpleReactStream builder = orgBuilder;
for (int i = 0; i < 1000; i++) {
builder = builder.then(input -> input + " " + counter++);
}
List<String> results = orgBuilder.block();
assertThat(results.get(0), is("Hello"));
List<String> completeResults = builder.block();
assertThat(completeResults.get(0).length(), greaterThan(100));
}
use of com.oath.cyclops.types.futurestream.BaseSimpleReactStream in project cyclops by aol.
the class SimpleReactTest method syncAndAsyncTest.
@Test
public void syncAndAsyncTest() {
BaseSimpleReactStream stream = BaseSimpleReactStream.of(1, 2, 3, 4).sync().async();
assertThat(stream.isAsync(), is(true));
}
use of com.oath.cyclops.types.futurestream.BaseSimpleReactStream in project cyclops by aol.
the class SimpleReactTest method asyncSyncTest.
@Test
public void asyncSyncTest() {
BaseSimpleReactStream stream = BaseSimpleReactStream.of(1, 2, 3, 4).async().sync();
assertThat(stream.isAsync(), is(false));
}
Aggregations