@Override public void onSubscribe(Subscription s) { if (SubscriptionHelper.validate(this.s, s)) { this.s = s; if (beforeDownstream()) { actual.onSubscribe(this); afterDownstream(); } } }
/** * Throws if the exception is fatal, otherwise cancels * the subscription and calls error(). * @param ex */ protected final void fail(Throwable ex) { ExceptionHelper.throwIfFatal(ex); s.cancel(); error(ex); }