@Test public void cancel() { TestSubscriber<Object> ts = new TestSubscriber<>(); CompletableFuture<Integer> cf = new CompletableFuture<>(); Single.create(cf) .subscribe(ts); ts.cancel(); cf.complete(1); ts.assertEmpty(); }
@Override public Single<T> cancel() { Single<T> single = super.cancel(); source.toCompletableFuture().cancel(true); return single; }
SingleFromCompletionStage extends CompletionSingle<T> { @Override public Single<T> cancel() { Single<T> single = super.cancel(); source.toCompletableFuture().cancel(true); return single; } }
SingleFromCompletionStage extends CompletionSingle<T> { @Override public Single<T> cancel() { Single<T> single = super.cancel(); source.toCompletableFuture().cancel(true); return single; } SingleFromCompletionStage(CompletionStage<T> source, boolean nullMeansEmpty); }
SingleFromCompletionStage extends CompletionSingle<T> { @Override public Single<T> cancel() { Single<T> single = super.cancel(); source.toCompletableFuture().cancel(true); return single; } SingleFromCompletionStage(CompletionStage<T> source, boolean nullMeansEmpty); @Override void subscribe(Flow.Subscriber<? super T> subscriber); @Override Single<T> cancel(); }
SingleFromCompletionStage extends CompletionSingle<T> { @Override public Single<T> cancel() { Single<T> single = super.cancel(); source.toCompletableFuture().cancel(true); return single; } SingleFromCompletionStage(CompletionStage<T> source, boolean nullMeansEmpty); @Override void subscribe(Flow.Subscriber<? super T> subscriber); @Override Single<T> cancel();  }