Skip to content

Commit

Permalink
v0.95 release
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmcclean committed Jun 11, 2015
1 parent f69d8cd commit 471786d
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 37 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ apply plugin: 'jacoco'
apply from: custom('jacoco-version')

sourceCompatibility = 1.8
version = '1.0.0'
version = '0.95'
jar {
manifest {
attributes 'Implementation-Title': 'Simple React', 'Implementation-Version': version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public SimpleReactStream<Integer> range(int startInclusive, int endExclusive){
* Start a reactive flow from a JDK Iterator
*
* @param iterator SimpleReact will iterate over this iterator concurrently to start the reactive dataflow
* @param maxTimes Maximum number of iterations
* @return Next stage in the reactive flow
*/
@SuppressWarnings("unchecked")
Expand All @@ -68,8 +67,7 @@ public <R> SimpleReactStream<R> of(final Collection<R> collection){
/**
* Start a reactive flow from a JDK Iterator
*
* @param iterator SimpleReact will iterate over this iterator concurrently to start the reactive dataflow
* @param maxTimes Maximum number of iterations
* @param iter SimpleReact will iterate over this iterator concurrently to start the reactive dataflow
* @return Next stage in the reactive flow
*/
@SuppressWarnings("unchecked")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ public <U> EagerFutureStream<U> react(Collection<Supplier<U>> actions) {
* Start a LazyFutureStream from a JDK Iterator
*
* @param iterator SimpleReact will iterate over this iterator concurrently to start the reactive dataflow
* @param maxTimes Maximum number of iterations
* @return Next stage in the reactive flow
*/
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ public <U> LazyFutureStream<U> react(Collection<Supplier<U>> actions) {
* Start a LazyFutureStream from a JDK Iterator
*
* @param iterator SimpleReact will iterate over this iterator concurrently to start the reactive dataflow
* @param maxTimes Maximum number of iterations
* @return Next stage in the reactive flow
*/
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,15 @@

import static java.util.Spliterator.ORDERED;
import static java.util.Spliterators.spliteratorUnknownSize;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;

import java.io.IOException;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Random;
import java.util.TreeSet;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
Expand All @@ -30,24 +23,19 @@
import java.util.function.Supplier;
import java.util.stream.Collector;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;

import org.jooq.lambda.Seq;
import org.jooq.lambda.tuple.Tuple;
import org.jooq.lambda.tuple.Tuple2;
import org.pcollections.HashTreePMap;

import com.aol.simple.react.RetryBuilder;
import com.aol.simple.react.async.Continueable;
import com.aol.simple.react.async.Queue;
import com.aol.simple.react.async.QueueFactories;
import com.aol.simple.react.async.QueueFactory;
import com.aol.simple.react.async.Queue.ClosedQueueException;
import com.aol.simple.react.collectors.lazy.LazyResultConsumer;
import com.aol.simple.react.exceptions.SimpleReactFailedStageException;
import com.aol.simple.react.predicates.Predicates;
import com.aol.simple.react.stream.StreamWrapper;
import com.aol.simple.react.stream.ThreadPools;
import com.aol.simple.react.stream.eager.EagerFutureStreamImpl;
Expand Down Expand Up @@ -239,7 +227,7 @@ default EagerFutureStream<Collection<U>> chunkSinceLastRead() {
*
* Stream<Integer> evenStream = evenQueue.stream();
* }
*
* </pre>
*
*
* results in 2 Streams "even": 10,20,30 "odd" : 25,41,43
Expand Down Expand Up @@ -933,6 +921,19 @@ default <R> EagerFutureStream<R> retry(Function<U, R> fn) {
}

/*
* <pre>
* {@code
* Set<Integer> result = new EagerReact()
.<Integer> react(() -> 1, () -> 2, () -> 3, () -> 5)
.then( it -> it*100)
.allOf(Collectors.toSet(), it -> it.size())
.first();
*
* }
*
* </pre>
*
* (non-Javadoc)
*
* @see
Expand All @@ -946,6 +947,21 @@ default <T, R> EagerFutureStream<R> allOf(Collector collector,
return (EagerFutureStream) FutureStream.super.allOf(collector, fn);
}

/*
* <pre>
* {@code
* new EagerReact().react(() -> 1)
* .then(this::load)
.anyOf(this::process)
.first();
*
* }
*
* </pre>
*
*
* @see com.aol.simple.react.stream.traits.FutureStream#anyOf(java.util.function.Function)
*/
default <R> EagerFutureStream<R> anyOf(Function<U, R> fn) {

return (EagerFutureStream) FutureStream.super.anyOf(fn);
Expand Down Expand Up @@ -1081,10 +1097,14 @@ default EagerFutureStream<U> skip(long n) {
/**
* Concatenate two streams.
*
* <pre>
* {@code
* // (1, 2, 3, 4, 5, 6)
* EagerFutureStream.of(1, 2,3).concat(Stream.of(4, 5, 6))
*
* // (1, 2, 3, 4, 5, 6) EagerFutureStream.of(1, 2,
* 3).concat(EagerFutureStream.of(4, 5, 6))
*
* }
* </pre>
*
* @see #concat(Stream[])
*/
Expand All @@ -1095,7 +1115,19 @@ default EagerFutureStream<U> concat(Stream<U> other) {
return (EagerFutureStream) merge((SimpleReactStream) other);
return fromStream(FutureStream.super.concat(other));
}

/**
* Concatenate two streams.
*
* <pre>
* {@code
* // (1, 2, 3, 4, 5, 6)
* EagerFutureStream.of(1, 2,3).concat(EagerFutureStream.of(4, 5, 6))
*
*
* }
* </pre>
* @see #concat(Stream[])
*/
default FutureStream<U> concat(SimpleReactStream<U> other) {

return (EagerFutureStream) merge((SimpleReactStream) other);
Expand Down Expand Up @@ -1130,28 +1162,16 @@ default EagerFutureStream<U> concat(U... other) {
.of(other));
}

/**
* Repeat a stream infinitely.
*
*
* // (1, 2, 3, 1, 2, 3, ...) EagerFutureStream.of(1, 2, 3).cycle();
*
*
* @see #cycle(Stream)
* **/
@Override
default EagerFutureStream<U> cycle() { return
fromStream(FutureStream.super.cycle());
}


/**
* Returns a limited interval from a given Stream.
*
*
* // (4, 5) EagerFutureStream.of(1, 2, 3, 4, 5, 6).slice(3, 5)
* // (4, 5) EagerFutureStream.of(1, 2, 3, 4, 5, 6).sliceFutures(3, 5)
*
*
* @see #slice(Stream, long, long)
* @see #slice(long, long)
*/

default EagerFutureStream<U> sliceFutures(long from, long to) {
Expand All @@ -1160,6 +1180,16 @@ default EagerFutureStream<U> sliceFutures(long from, long to) {
return fromListCompletableFuture(noType);
}

/**
* Returns a limited interval from a given Stream.
*
*
* // (4, 5) EagerFutureStream.of(1, 2, 3, 4, 5, 6).slice(3, 5)
*
*
* @see #slice(Stream, long, long)
*/

@Override
default EagerFutureStream<U> slice(long from, long to) {

Expand Down

0 comments on commit 471786d

Please sign in to comment.