
hu.akarnokd.reactive.rpc.DeferredSubscription Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of akarnokd-reactive-rpc Show documentation
Show all versions of akarnokd-reactive-rpc Show documentation
akarnokd-reactive-rpc developed by David Karnok
The newest version!
package hu.akarnokd.reactive.rpc;
import java.util.concurrent.atomic.*;
import org.reactivestreams.Subscription;
import io.reactivex.internal.subscriptions.SubscriptionHelper;
public class DeferredSubscription extends AtomicReference implements Subscription {
private static final long serialVersionUID = 8746019642539166854L;
final AtomicLong requested = new AtomicLong();
@Override
public void cancel() {
SubscriptionHelper.cancel(this);
}
@Override
public void request(long n) {
SubscriptionHelper.deferredRequest(this, requested, n);
}
public void setSubscription(Subscription s) {
SubscriptionHelper.deferredSetOnce(this, requested, s);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy