Skip to content

Commit

Permalink
remove ambiguous takeUntil
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephane Maldini committed Mar 2, 2016
1 parent 460a53e commit 732820a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 192 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

[![Build Status](https://drone.io/github.com/reactor/reactor-core/status.png)](https://drone.io/github.com/reactor/reactor-core/latest)

Non-Blocking [Reactive Streams](http://reactive-streams.org) Foundation for the JVM both implementing a lite [Reactive Extensions]
(http://reactivex.io) API and efficient message-passing support.
Non-Blocking [Reactive Streams](http://reactive-streams.org) Foundation for the JVM both implementing a [Reactive Extensions]
(http://reactivex.io) inspired API and efficient message-passing support.

## Getting it
[![Reactor Core](https://maven-badges.herokuapp.com/maven-central/io.projectreactor/reactor-core/badge.svg?style=plastic)](http://mvnrepository.com/artifact/io.projectreactor/reactor-core)
Expand All @@ -27,7 +27,8 @@ With Gradle from repo.spring.io or Maven Central repositories (stable releases o

## Getting Started

New to Reactive Programming or bored of reading already ? Try the [Introduction to Reactor Rx Lite hands-on](https://github.com/reactor/lite-rx-api-hands-on) !
New to Reactive Programming or bored of reading already ? Try the [Introduction to Reactor Core hands-on](https://github
.com/reactor/lite-rx-api-hands-on) !

## Flux

Expand Down
17 changes: 0 additions & 17 deletions src/main/java/reactor/core/publisher/Flux.java
Original file line number Diff line number Diff line change
Expand Up @@ -3734,23 +3734,6 @@ public final Flux<T> takeLast(int n) {
return new FluxTakeLast<>(this, n);
}


/**
* Relay values until a predicate returns {@literal TRUE}, indicating the sequence should stop
* (checked after each value has been delivered).
*
* <p>
* <img width="500" src="https://raw.githubusercontent.com/reactor/projectreactor.io/master/src/main/static/assets/img/marble/takeuntilp.png" alt="">
*
* @param stopPredicate the {@link Predicate} invoked each onNext returning {@literal TRUE} to terminate
*
* @return an eventually limited {@link Flux}
*
*/
public final Flux<T> takeUntil(Predicate<? super T> stopPredicate) {
return new FluxTakeUntilPredicate<>(this, stopPredicate);
}

/**
* Relay values from this {@link Flux} until the given {@link Publisher} emits.
*
Expand Down
170 changes: 0 additions & 170 deletions src/main/java/reactor/core/publisher/FluxTakeUntilPredicate.java

This file was deleted.

4 changes: 2 additions & 2 deletions src/main/java/reactor/core/publisher/Mono.java
Original file line number Diff line number Diff line change
Expand Up @@ -1251,13 +1251,13 @@ public final Mono<T> repeatUntilNext(Function<Flux<Long>, ? extends Publisher<?>
*/
public final Mono<T> repeatUntilNext(int maxRepeat, Function<Flux<Long>, ? extends Publisher<?>> repeatFactory) {
if (maxRepeat != Integer.MAX_VALUE) {
Function<Flux<Long>, Flux<Long>> skip = f -> f.takeUntil(v -> { return v != 0L; });
Function<Flux<Long>, Flux<Long>> skip = f -> f.takeWhile(v -> v == 0L);
return MonoSource.wrap(new FluxRepeatWhen<T>(this,
skip.andThen(flux -> flux.zipWith(Flux.range(0, maxRepeat), (a, b) -> b)
.map(a -> (long)a))
.andThen(repeatFactory)));
}
Function<Flux<Long>, Flux<Long>> skip = f -> f.takeUntil(v -> { return v != 0L; }).scan(0L, (v, acc) -> acc++);
Function<Flux<Long>, Flux<Long>> skip = f -> f.takeWhile(v -> v == 0L).scan(0L, (v, acc) -> acc++);
return MonoSource.wrap(new FluxRepeatWhen<T>(this, skip.andThen(repeatFactory)));
}

Expand Down

0 comments on commit 732820a

Please sign in to comment.