Skip to content

Commit

Permalink
rename emitters #isCancelled to #isDisposed (#4490)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mauin authored and akarnokd committed Sep 6, 2016
1 parent ff3c5d0 commit 10f727f
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 36 deletions.
6 changes: 3 additions & 3 deletions src/main/java/io/reactivex/CompletableEmitter.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ public interface CompletableEmitter {
void setCancellable(Cancellable c);

/**
* Returns true if the downstream cancelled the sequence.
* @return true if the downstream cancelled the sequence
* Returns true if the downstream disposed the sequence.
* @return true if the downstream disposed the sequence
*/
boolean isCancelled();
boolean isDisposed();
}
2 changes: 1 addition & 1 deletion src/main/java/io/reactivex/MaybeEmitter.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@ public interface MaybeEmitter<T> {
* Returns true if the downstream cancelled the sequence.
* @return true if the downstream cancelled the sequence
*/
boolean isCancelled();
boolean isDisposed();
}
10 changes: 5 additions & 5 deletions src/main/java/io/reactivex/ObservableEmitter.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ public interface ObservableEmitter<T> extends Emitter<T> {
* @param c the cancellable resource, null is allowed
*/
void setCancellable(Cancellable c);

/**
* Returns true if the downstream cancelled the sequence.
* @return true if the downstream cancelled the sequence
* Returns true if the downstream disposed the sequence.
* @return true if the downstream disposed the sequence
*/
boolean isCancelled();
boolean isDisposed();

/**
* Ensures that calls to onNext, onError and onComplete are properly serialized.
* @return the serialized FlowableEmitter
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/reactivex/SingleEmitter.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,5 @@ public interface SingleEmitter<T> {
* Returns true if the downstream cancelled the sequence.
* @return true if the downstream cancelled the sequence
*/
boolean isCancelled();
boolean isDisposed();
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,6 @@ public void setCancellable(Cancellable c) {
setDisposable(new CancellableDisposable(c));
}

@Override
public boolean isCancelled() {
return DisposableHelper.isDisposed(get());
}

@Override
public void dispose() {
DisposableHelper.dispose(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,6 @@ public void setCancellable(Cancellable c) {
setDisposable(new CancellableDisposable(c));
}

@Override
public boolean isCancelled() {
return DisposableHelper.isDisposed(get());
}

@Override
public void dispose() {
DisposableHelper.dispose(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,6 @@ public void setCancellable(Cancellable c) {
setDisposable(new CancellableDisposable(c));
}

@Override
public boolean isCancelled() {
return isDisposed();
}

@Override
public ObservableEmitter<T> serialize() {
return new SerializedEmitter<T>(this);
Expand Down Expand Up @@ -152,7 +147,7 @@ public SerializedEmitter(ObservableEmitter<T> emitter) {

@Override
public void onNext(T t) {
if (emitter.isCancelled() || done) {
if (emitter.isDisposed() || done) {
return;
}
if (t == null) {
Expand All @@ -178,7 +173,7 @@ public void onNext(T t) {

@Override
public void onError(Throwable t) {
if (emitter.isCancelled() || done) {
if (emitter.isDisposed() || done) {
RxJavaPlugins.onError(t);
return;
}
Expand All @@ -195,7 +190,7 @@ public void onError(Throwable t) {

@Override
public void onComplete() {
if (emitter.isCancelled() || done) {
if (emitter.isDisposed() || done) {
return;
}
done = true;
Expand All @@ -216,7 +211,7 @@ void drainLoop() {
for (;;) {

for (;;) {
if (e.isCancelled()) {
if (e.isDisposed()) {
q.clear();
return;
}
Expand Down Expand Up @@ -270,8 +265,8 @@ public void setCancellable(Cancellable c) {
}

@Override
public boolean isCancelled() {
return emitter.isCancelled();
public boolean isDisposed() {
return emitter.isDisposed();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,6 @@ public void setCancellable(Cancellable c) {
setDisposable(new CancellableDisposable(c));
}

@Override
public boolean isCancelled() {
return DisposableHelper.isDisposed(get());
}

@Override
public void dispose() {
DisposableHelper.dispose(this);
Expand Down

0 comments on commit 10f727f

Please sign in to comment.