void scheduleTimeout(long idx) {
      Disposable d = timer;
      if (d != null) {
        d.dispose();
      }

      if (TIMER.compareAndSet(this, d, NEW_TIMER)) {
        d =
            worker.schedule(
                () -> {
                  if (idx == index) {
                    done = true;
                    s.dispose();
                    dispose();

                    actual.onError(new TimeoutException());
                  }
                },
                timeout,
                unit);

        if (!TIMER.compareAndSet(this, NEW_TIMER, d)) {
          d.dispose();
        }
      }
    }
    @Override
    public void onError(Throwable t) {
      if (done) {
        RxJavaPlugins.onError(t);
        return;
      }
      done = true;
      dispose();

      actual.onError(t);
    }