class SwitchableSubscriptionSubscriber implements MultiSubscriber<O>, Subscription {

    @Override
    public final void request(long n) {
        if (n <= 0) {
            downstream.onError(Subscriptions.getInvalidRequestException());
            return;
        }

        if (unbounded) {
            return;
        }
        if (wip.compareAndSet(0, 1)) {
            long r = requested;

            if (r != Long.MAX_VALUE) {
                r = Subscriptions.add(r, n);
                requested = r;
                if (r == Long.MAX_VALUE) {
                    unbounded = true;
                }
            }
            Subscription actual = currentUpstream.get();

            if (wip.decrementAndGet() != 0) {
                drainLoop();
            }

            if (actual != null) {
                actual.request(n);
            }

            return;
        }

        Subscriptions.add(missedRequested, n);

        drain();
    }

    public  SwitchableSubscriptionSubscriber(MultiSubscriber<? super O> downstream);

}