@Test public void testNonResubscribeableCompletable() { TestCompletable source = new TestCompletable.Builder() .singleSubscriber() .build(); source.subscribe(subscriber1); assertTrue(subscriber1.cancellableReceived()); source.onComplete(); assertThat(subscriber1.takeTerminal(), is(complete())); source.subscribe(subscriber2); expected.expect(RuntimeException.class); expected.expectMessage("Unexpected exception(s) encountered"); expected.expectCause(allOf(instanceOf(IllegalStateException.class), hasProperty("message", startsWith("Duplicate subscriber")))); source.onComplete(); }
public final Cancellable subscribe() { SimpleCompletableSubscriber subscriber = new SimpleCompletableSubscriber(); subscribeInternal(subscriber); return subscriber; }
Completable { public final Cancellable subscribe() { SimpleCompletableSubscriber subscriber = new SimpleCompletableSubscriber(); subscribeInternal(subscriber); return subscriber; } }
Completable { public final Cancellable subscribe() { SimpleCompletableSubscriber subscriber = new SimpleCompletableSubscriber(); subscribeInternal(subscriber); return subscriber; } protected  Completable();   Completable(final Executor executor);   Completable(Executor executor, boolean shareContextOnSubscribe); }
Completable { public final Cancellable subscribe() { SimpleCompletableSubscriber subscriber = new SimpleCompletableSubscriber(); subscribeInternal(subscriber); return subscriber; } protected  Completable();   Completable(final Executor executor);   Completable(Executor executor, boolean shareContextOnSubscribe); final Completable onErrorResume(Function<Throwable, ? extends Completable> nextFactory); final Completable whenOnComplete(Runnable onComplete); final Completable whenOnError(Consumer<Throwable> onError); final Completable whenFinally(Runnable doFinally); final Completable whenFinally(TerminalSignalConsumer doFinally); final Completable whenCancel(Runnable onCancel); final Completable idleTimeout(long duration, TimeUnit unit); final Completable idleTimeout(long duration, TimeUnit unit, Executor timeoutExecutor); final Completable idleTimeout(Duration duration); final Completable idleTimeout(Duration duration, Executor timeoutExecutor); final Completable concat(Completable next); final Single<T> concat(Single<? extends T> next); final Publisher<T> concat(Publisher<? extends T> next); final Completable merge(Completable... other); final Completable merge(Iterable<? extends Completable> other); final Publisher<T> merge(Publisher<? extends T> mergeWith); final Completable mergeDelayError(Completable... other); final Completable mergeDelayError(Iterable<? extends Completable> other); final Completable retry(BiIntPredicate<Throwable> shouldRetry); final Completable retryWhen(BiIntFunction<Throwable, ? extends Completable> retryWhen); final Publisher<Void> repeat(IntPredicate shouldRepeat); final Publisher<Void> repeatWhen(IntFunction<? extends Completable> repeatWhen); final Completable beforeOnSubscribe(Consumer<Cancellable> onSubscribe); final Completable beforeOnComplete(Runnable onComplete); final Completable beforeOnError(Consumer<Throwable> onError); final Completable beforeCancel(Runnable onCancel); final Completable beforeFinally(Runnable doFinally); final Completable beforeFinally(TerminalSignalConsumer doFinally); final Completable beforeSubscriber(Supplier<? extends Subscriber> subscriberSupplier); final Completable afterOnSubscribe(Consumer<Cancellable> onSubscribe); final Completable whenOnSubscribe(Consumer<Cancellable> onSubscribe); final Completable afterOnComplete(Runnable onComplete); final Completable afterOnError(Consumer<Throwable> onError); final Completable afterCancel(Runnable onCancel); final Completable afterFinally(Runnable doFinally); final Completable afterFinally(TerminalSignalConsumer doFinally); final Completable afterSubscriber(Supplier<? extends Subscriber> subscriberSupplier); final Completable whenSubscriber(Supplier<? extends Subscriber> subscriberSupplier); final Completable liftSync(CompletableOperator operator); final Completable liftAsync(CompletableOperator operator); final Completable publishOn(Executor executor); final Completable publishOnOverride(Executor executor); final Completable subscribeOn(Executor executor); final Completable subscribeOnOverride(Executor executor); final Completable publishAndSubscribeOn(Executor executor); final Completable publishAndSubscribeOnOverride(Executor executor); final Completable subscribeShareContext(); final Completable ambWith(final Completable other); final Publisher<T> toPublisher(); final Single<Void> toSingle(); final CompletionStage<Void> toCompletionStage(); final Future<Void> toFuture(); final Cancellable subscribe(); final Cancellable subscribe(Runnable onComplete); static Completable completed(); static Completable fromRunnable(final Runnable runnable); static Completable failed(Throwable cause); static Completable never(); static Completable defer(Supplier<? extends Completable> completableSupplier); static Completable fromFuture(Future<?> future); static Completable fromStage(CompletionStage<?> stage); static Completable mergeAll(Iterable<? extends Completable> completables); static Completable mergeAll(Completable... completables); static Completable mergeAll(Iterable<? extends Completable> completables, int maxConcurrency); static Completable mergeAll(int maxConcurrency, Completable... completables); static Completable mergeAllDelayError(Iterable<? extends Completable> completables); static Completable mergeAllDelayError(Completable... completables); static Completable mergeAllDelayError(Iterable<? extends Completable> completables, int maxConcurrency); static Completable mergeAllDelayError(int maxConcurrency, Completable... completables); static Completable amb(final Completable... completables); static Completable amb(final Iterable<Completable> completables); static Completable anyOf(final Completable... completables); static Completable anyOf(final Iterable<Completable> completables); }
Completable { public final Cancellable subscribe() { SimpleCompletableSubscriber subscriber = new SimpleCompletableSubscriber(); subscribeInternal(subscriber); return subscriber; } protected  Completable();   Completable(final Executor executor);   Completable(Executor executor, boolean shareContextOnSubscribe); final Completable onErrorResume(Function<Throwable, ? extends Completable> nextFactory); final Completable whenOnComplete(Runnable onComplete); final Completable whenOnError(Consumer<Throwable> onError); final Completable whenFinally(Runnable doFinally); final Completable whenFinally(TerminalSignalConsumer doFinally); final Completable whenCancel(Runnable onCancel); final Completable idleTimeout(long duration, TimeUnit unit); final Completable idleTimeout(long duration, TimeUnit unit, Executor timeoutExecutor); final Completable idleTimeout(Duration duration); final Completable idleTimeout(Duration duration, Executor timeoutExecutor); final Completable concat(Completable next); final Single<T> concat(Single<? extends T> next); final Publisher<T> concat(Publisher<? extends T> next); final Completable merge(Completable... other); final Completable merge(Iterable<? extends Completable> other); final Publisher<T> merge(Publisher<? extends T> mergeWith); final Completable mergeDelayError(Completable... other); final Completable mergeDelayError(Iterable<? extends Completable> other); final Completable retry(BiIntPredicate<Throwable> shouldRetry); final Completable retryWhen(BiIntFunction<Throwable, ? extends Completable> retryWhen); final Publisher<Void> repeat(IntPredicate shouldRepeat); final Publisher<Void> repeatWhen(IntFunction<? extends Completable> repeatWhen); final Completable beforeOnSubscribe(Consumer<Cancellable> onSubscribe); final Completable beforeOnComplete(Runnable onComplete); final Completable beforeOnError(Consumer<Throwable> onError); final Completable beforeCancel(Runnable onCancel); final Completable beforeFinally(Runnable doFinally); final Completable beforeFinally(TerminalSignalConsumer doFinally); final Completable beforeSubscriber(Supplier<? extends Subscriber> subscriberSupplier); final Completable afterOnSubscribe(Consumer<Cancellable> onSubscribe); final Completable whenOnSubscribe(Consumer<Cancellable> onSubscribe); final Completable afterOnComplete(Runnable onComplete); final Completable afterOnError(Consumer<Throwable> onError); final Completable afterCancel(Runnable onCancel); final Completable afterFinally(Runnable doFinally); final Completable afterFinally(TerminalSignalConsumer doFinally); final Completable afterSubscriber(Supplier<? extends Subscriber> subscriberSupplier); final Completable whenSubscriber(Supplier<? extends Subscriber> subscriberSupplier); final Completable liftSync(CompletableOperator operator); final Completable liftAsync(CompletableOperator operator); final Completable publishOn(Executor executor); final Completable publishOnOverride(Executor executor); final Completable subscribeOn(Executor executor); final Completable subscribeOnOverride(Executor executor); final Completable publishAndSubscribeOn(Executor executor); final Completable publishAndSubscribeOnOverride(Executor executor); final Completable subscribeShareContext(); final Completable ambWith(final Completable other); final Publisher<T> toPublisher(); final Single<Void> toSingle(); final CompletionStage<Void> toCompletionStage(); final Future<Void> toFuture(); final Cancellable subscribe(); final Cancellable subscribe(Runnable onComplete); static Completable completed(); static Completable fromRunnable(final Runnable runnable); static Completable failed(Throwable cause); static Completable never(); static Completable defer(Supplier<? extends Completable> completableSupplier); static Completable fromFuture(Future<?> future); static Completable fromStage(CompletionStage<?> stage); static Completable mergeAll(Iterable<? extends Completable> completables); static Completable mergeAll(Completable... completables); static Completable mergeAll(Iterable<? extends Completable> completables, int maxConcurrency); static Completable mergeAll(int maxConcurrency, Completable... completables); static Completable mergeAllDelayError(Iterable<? extends Completable> completables); static Completable mergeAllDelayError(Completable... completables); static Completable mergeAllDelayError(Iterable<? extends Completable> completables, int maxConcurrency); static Completable mergeAllDelayError(int maxConcurrency, Completable... completables); static Completable amb(final Completable... completables); static Completable amb(final Iterable<Completable> completables); static Completable anyOf(final Completable... completables); static Completable anyOf(final Iterable<Completable> completables);  }