@Test public void offloadSubscribeSingle() { Consumer<SingleSource.Subscriber<? super Integer>> handleSubscribe = uncheckedMock(Consumer.class); offloader.offloadSubscribe(singleSub, handleSubscribe); verify(executor.mock).execute(any()); verifyZeroInteractions(singleSub); verifyZeroInteractions(handleSubscribe); assertThat("Unexpected tasks executed.", executor.executeAllTasks(), is(1)); verify(handleSubscribe).accept(singleSub); }
@Override public <T> void offloadSubscribe(final Subscriber<? super T> subscriber, final Consumer<Subscriber<? super T>> handleSubscribe) { try { executor.execute(() -> handleSubscribe.accept(subscriber)); } catch (Throwable throwable) { deliverErrorFromSource(subscriber, throwable); } }
TaskBasedSignalOffloader implements SignalOffloader { @Override public <T> void offloadSubscribe(final Subscriber<? super T> subscriber, final Consumer<Subscriber<? super T>> handleSubscribe) { try { executor.execute(() -> handleSubscribe.accept(subscriber)); } catch (Throwable throwable) { deliverErrorFromSource(subscriber, throwable); } } }
TaskBasedSignalOffloader implements SignalOffloader { @Override public <T> void offloadSubscribe(final Subscriber<? super T> subscriber, final Consumer<Subscriber<? super T>> handleSubscribe) { try { executor.execute(() -> handleSubscribe.accept(subscriber)); } catch (Throwable throwable) { deliverErrorFromSource(subscriber, throwable); } } TaskBasedSignalOffloader(final Executor executor);   TaskBasedSignalOffloader(final Executor executor, final int publisherSignalQueueInitialCapacity); }
TaskBasedSignalOffloader implements SignalOffloader { @Override public <T> void offloadSubscribe(final Subscriber<? super T> subscriber, final Consumer<Subscriber<? super T>> handleSubscribe) { try { executor.execute(() -> handleSubscribe.accept(subscriber)); } catch (Throwable throwable) { deliverErrorFromSource(subscriber, throwable); } } TaskBasedSignalOffloader(final Executor executor);   TaskBasedSignalOffloader(final Executor executor, final int publisherSignalQueueInitialCapacity); @Override Subscriber<? super T> offloadSubscriber(final Subscriber<? super T> subscriber); @Override SingleSource.Subscriber<? super T> offloadSubscriber(
            final SingleSource.Subscriber<? super T> subscriber); @Override CompletableSource.Subscriber offloadSubscriber(final CompletableSource.Subscriber subscriber); @Override Subscriber<? super T> offloadSubscription(final Subscriber<? super T> subscriber); @Override SingleSource.Subscriber<? super T> offloadCancellable(
            final SingleSource.Subscriber<? super T> subscriber); @Override CompletableSource.Subscriber offloadCancellable(final CompletableSource.Subscriber subscriber); @Override void offloadSubscribe(final Subscriber<? super T> subscriber,
                                     final Consumer<Subscriber<? super T>> handleSubscribe); @Override void offloadSubscribe(final SingleSource.Subscriber<? super T> subscriber,
                                     final Consumer<SingleSource.Subscriber<? super T>> handleSubscribe); @Override void offloadSubscribe(final CompletableSource.Subscriber subscriber,
                                 final Consumer<CompletableSource.Subscriber> handleSubscribe); @Override void offloadSignal(final T signal, final Consumer<T> signalConsumer); }
TaskBasedSignalOffloader implements SignalOffloader { @Override public <T> void offloadSubscribe(final Subscriber<? super T> subscriber, final Consumer<Subscriber<? super T>> handleSubscribe) { try { executor.execute(() -> handleSubscribe.accept(subscriber)); } catch (Throwable throwable) { deliverErrorFromSource(subscriber, throwable); } } TaskBasedSignalOffloader(final Executor executor);   TaskBasedSignalOffloader(final Executor executor, final int publisherSignalQueueInitialCapacity); @Override Subscriber<? super T> offloadSubscriber(final Subscriber<? super T> subscriber); @Override SingleSource.Subscriber<? super T> offloadSubscriber(
            final SingleSource.Subscriber<? super T> subscriber); @Override CompletableSource.Subscriber offloadSubscriber(final CompletableSource.Subscriber subscriber); @Override Subscriber<? super T> offloadSubscription(final Subscriber<? super T> subscriber); @Override SingleSource.Subscriber<? super T> offloadCancellable(
            final SingleSource.Subscriber<? super T> subscriber); @Override CompletableSource.Subscriber offloadCancellable(final CompletableSource.Subscriber subscriber); @Override void offloadSubscribe(final Subscriber<? super T> subscriber,
                                     final Consumer<Subscriber<? super T>> handleSubscribe); @Override void offloadSubscribe(final SingleSource.Subscriber<? super T> subscriber,
                                     final Consumer<SingleSource.Subscriber<? super T>> handleSubscribe); @Override void offloadSubscribe(final CompletableSource.Subscriber subscriber,
                                 final Consumer<CompletableSource.Subscriber> handleSubscribe); @Override void offloadSignal(final T signal, final Consumer<T> signalConsumer);  }