Skip to content

A simple API, and a Rich API

johnmcclean-aol edited this page Feb 23, 2015 · 9 revisions

#SimpleReact Provides 3 Streams

EagerFutureStream and LazyFutureStream get all the functionality in this page.

SimpleReactStream is a simpler, more focused API with only the SimpleReact Core API features.

SimpleReact Core API

The core SimpleReact API remains very simple. Although it has expanded slightly since the initial release it is today :-

  • with
  • then
  • retry
  • onFail
  • capture
  • block
  • allOf
  • run
  • toQueue
  • flatMap
  • peek
  • filter
  • merge

These are the concurrent non-blocking operations (except for block!) that represent the core of the API.

#java.util.stream.Stream

With SimpleReact v0.3 we have also added all the methods of the Stream api to this 👍

  • filter(Predicate<? super T>)
  • map(Function<? super T, ? extends R>)
  • mapToInt(ToIntFunction<? super T>)
  • mapToLong(ToLongFunction<? super T>)
  • mapToDouble(ToDoubleFunction<? super T>)
  • flatMap(Function<? super T, ? extends Stream<? extends R>>)
  • flatMapToInt(Function<? super T, ? extends IntStream>)
  • flatMapToLong(Function<? super T, ? extends LongStream>)
  • flatMapToDouble(Function<? super T, ? extends DoubleStream>)
  • distinct()
  • sorted()
  • sorted(Comparator<? super T>)
  • peek(Consumer<? super T>)
  • limit(long)
  • skip(long)
  • forEach(Consumer<? super T>)
  • forEachOrdered(Consumer<? super T>)
  • toArray()
  • toArray(IntFunction<A[]>)
  • reduce(T, BinaryOperator)
  • reduce(BinaryOperator)
  • reduce(U, BiFunction<U, ? super T, U>, BinaryOperator)
  • collect(Supplier, BiConsumer<R, ? super T>, BiConsumer<R, R>)
  • collect(Collector<? super T, A, R>)
  • min(Comparator<? super T>)
  • max(Comparator<? super T>)
  • count()
  • anyMatch(Predicate<? super T>)
  • allMatch(Predicate<? super T>)
  • noneMatch(Predicate<? super T>)
  • findFirst()
  • findAny()
  • builder()
  • empty()
  • of(T)
  • of(T...)
  • iterate(T, UnaryOperator)
  • generate(Supplier)
  • concat(Stream<? extends T>, Stream<? extends T>)

#org.jooq.lambda.Seq

And we have also implemented Seq, which adds the following functions

  • stream()
  • concat(Stream)
  • concat(T)
  • concat(T...)
  • cycle()
  • zip(Seq)
  • zip(Seq, BiFunction<T, U, R>)
  • zipWithIndex()
  • foldLeft(U, BiFunction<U, ? super T, U>)
  • foldRight(U, BiFunction<? super T, U, U>)
  • scanLeft(U, BiFunction<U, ? super T, U>)
  • scanRight(U, BiFunction<? super T, U, U>)
  • reverse()
  • shuffle()
  • shuffle(Random)
  • skipWhile(Predicate<? super T>)
  • skipUntil(Predicate<? super T>)
  • limitWhile(Predicate<? super T>)
  • limitUntil(Predicate<? super T>)
  • intersperse(T)
  • duplicate()
  • partition(Predicate<? super T>)
  • splitAt(long)
  • splitAtHead()
  • slice(long, long)
  • toCollection(Supplier)
  • toList()
  • toSet()
  • toMap(Function<T, K>, Function<T, V>)
  • toString(String)
  • minBy(Function<T, U>)
  • minBy(Function<T, U>, Comparator<? super U>)
  • maxBy(Function<T, U>)
  • maxBy(Function<T, U>, Comparator<? super U>)
  • ofType(Class)
  • cast(Class)
  • groupBy(Function<? super T, ? extends K>)
  • groupBy(Function<? super T, ? extends K>, Collector<? super T, A, D>)
  • groupBy(Function<? super T, ? extends K>, Supplier, Collector<? super T, A, D>)
  • join()
  • join(CharSequence)
  • join(CharSequence, CharSequence, CharSequence)
  • of(T)
  • of(T...)
  • empty()
  • iterate(T, UnaryOperator)
  • generate()
  • generate(T)
  • generate(Supplier)
  • seq(Stream)
  • seq(Iterable)
  • seq(Iterator)
  • seq(Map<K, V>)
  • seq(Optional)
  • cycle(Stream)
  • unzip(Stream<Tuple2<T1, T2>>)
  • unzip(Stream<Tuple2<T1, T2>>, Function<T1, U1>, Function<T2, U2>)
  • unzip(Stream<Tuple2<T1, T2>>, Function<Tuple2<T1, T2>, Tuple2<U1, U2>>)
  • unzip(Stream<Tuple2<T1, T2>>, BiFunction<T1, T2, Tuple2<U1, U2>>)
  • zip(Stream, Stream)
  • zip(Stream, Stream, BiFunction<T1, T2, R>)
  • zipWithIndex(Stream)
  • foldLeft(Stream, U, BiFunction<U, ? super T, U>)
  • foldRight(Stream, U, BiFunction<? super T, U, U>)
  • scanLeft(Stream, U, BiFunction<U, ? super T, U>)
  • scanRight(Stream, U, BiFunction<? super T, U, U>)
  • unfold(U, Function<U, Optional<Tuple2<T, U>>>)
  • reverse(Stream)
  • shuffle(Stream)
  • shuffle(Stream, Random)
  • concat(Stream...)
  • duplicate(Stream)
  • toString(Stream<?>)
  • toString(Stream<?>, String)
  • toCollection(Stream, Supplier)
  • toList(Stream)
  • toSet(Stream)
  • toMap(Stream<Tuple2<K, V>>)
  • toMap(Stream, Function<T, K>, Function<T, V>)
  • slice(Stream, long, long)
  • skip(Stream, long)
  • skipWhile(Stream, Predicate<? super T>)
  • skipUntil(Stream, Predicate<? super T>)
  • limit(Stream, long)
  • limitWhile(Stream, Predicate<? super T>)
  • limitUntil(Stream, Predicate<? super T>)
  • intersperse(Stream, T)
  • partition(Stream, Predicate<? super T>)
  • splitAt(Stream, long)
  • splitAtHead(Stream)
  • ofType(Stream, Class)
  • cast(Stream, Class)
  • groupBy(Stream, Function<? super T, ? extends K>)
  • groupBy(Stream, Function<? super T, ? extends K>, Collector<? super T, A, D>)
  • groupBy(Stream, Function<? super T, ? extends K>, Supplier, Collector<? super T, A, D>)
  • join(Stream<?>)
  • join(Stream<?>, CharSequence)
  • join(Stream<?>, CharSequence, CharSequence, CharSequence)
  • filter(Predicate<? super T>)
  • map(Function<? super T, ? extends R>)
  • mapToInt(ToIntFunction<? super T>)
  • mapToLong(ToLongFunction<? super T>)
  • mapToDouble(ToDoubleFunction<? super T>)
  • flatMap(Function<? super T, ? extends Stream<? extends R>>)
  • flatMapToInt(Function<? super T, ? extends IntStream>)
  • flatMapToLong(Function<? super T, ? extends LongStream>)
  • flatMapToDouble(Function<? super T, ? extends DoubleStream>)
  • distinct()
  • sorted()
  • sorted(Comparator<? super T>)
  • peek(Consumer<? super T>)
  • limit(long)
  • skip(long)
  • onClose(Runnable)
  • close()
  • sequential()
  • parallel()
  • unordered()
  • spliterator()
  • forEach(Consumer<? super T>)
Clone this wiki locally