code: public void _onSubscribe(Subscription subscription) {
          producer = subscription;
          ArrayList<Runnable> tmp = this.doOnSubscribe;
          this.doOnSubscribe = null;
          tmp.forEach(runnable -> runnable.run());
      }
docs: see onError() comment