@Override public T get() throws InterruptedException, ExecutionException { if (getCount() != 0) { await(); } if (isCancelled()) { throw new CancellationException(); } Throwable ex = error; if (ex != null) { throw new ExecutionException(ex); } return value; }
@Override public void onComplete() { for (;;) { Subscription a = upstream.get(); if (a == this || a == SubscriptionHelper.CANCELLED) { return; } if (upstream.compareAndSet(a, this)) { countDown(); return; } } }
/** * Converts this Perhaps into a Future and signals its single * value or null if this Perhaps is empty. * @return the new Future instance */ public final Future<T> toFuture() { FuturePerhapsSubscriber<T> fs = new FuturePerhapsSubscriber<T>(); subscribe(fs); return fs; } }
@Override public boolean isDone() { return getCount() == 0; }
/** * Converts this Nono into a Future and signals its single * value. * @return the new Future instance */ public final Future<Void> toFuture() { FuturePerhapsSubscriber<Void> fs = new FuturePerhapsSubscriber<Void>(); subscribe(fs); return fs; } }
@Override public boolean isDone() { return getCount() == 0; }
@Override public T get() throws InterruptedException, ExecutionException { if (getCount() != 0) { await(); } if (isCancelled()) { throw new CancellationException(); } Throwable ex = error; if (ex != null) { throw new ExecutionException(ex); } return value; }
@Override public void onComplete() { for (;;) { Subscription a = upstream.get(); if (a == this || a == SubscriptionHelper.CANCELLED) { return; } if (upstream.compareAndSet(a, this)) { countDown(); return; } } }
/** * Converts this Solo into a Future and signals its single * value. * @return the new Future instance */ public final Future<T> toFuture() { FuturePerhapsSubscriber<T> fs = new FuturePerhapsSubscriber<T>(); subscribe(fs); return fs; } }
@Override public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { if (getCount() != 0) { if (!await(timeout, unit)) { throw new TimeoutException(); } } if (isCancelled()) { throw new CancellationException(); } Throwable ex = error; if (ex != null) { throw new ExecutionException(ex); } return value; }
@Override public void onError(Throwable t) { for (;;) { Subscription a = upstream.get(); if (a == this || a == SubscriptionHelper.CANCELLED) { RxJavaPlugins.onError(t); return; } error = t; if (upstream.compareAndSet(a, this)) { countDown(); return; } } }
/** * Converts this Perhaps into a Future and signals its single * value or null if this Perhaps is empty. * @return the new Future instance */ public final Future<T> toFuture() { FuturePerhapsSubscriber<T> fs = new FuturePerhapsSubscriber<T>(); subscribe(fs); return fs; } }
@Override public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { if (getCount() != 0) { if (!await(timeout, unit)) { throw new TimeoutException(); } } if (isCancelled()) { throw new CancellationException(); } Throwable ex = error; if (ex != null) { throw new ExecutionException(ex); } return value; }
@Override public void onError(Throwable t) { for (;;) { Subscription a = upstream.get(); if (a == this || a == SubscriptionHelper.CANCELLED) { RxJavaPlugins.onError(t); return; } error = t; if (upstream.compareAndSet(a, this)) { countDown(); return; } } }
/** * Converts this Solo into a Future and signals its single * value. * @return the new Future instance */ public final Future<T> toFuture() { FuturePerhapsSubscriber<T> fs = new FuturePerhapsSubscriber<T>(); subscribe(fs); return fs; } }
@Override public boolean cancel(boolean mayInterruptIfRunning) { for (;;) { Subscription a = upstream.get(); if (a == this || a == SubscriptionHelper.CANCELLED) { return false; } if (upstream.compareAndSet(a, SubscriptionHelper.CANCELLED)) { if (a != null) { a.cancel(); } countDown(); return true; } } }
/** * Converts this Nono into a Future and signals its single * value. * @return the new Future instance */ public final Future<Void> toFuture() { FuturePerhapsSubscriber<Void> fs = new FuturePerhapsSubscriber<Void>(); subscribe(fs); return fs; } }
@Override public boolean cancel(boolean mayInterruptIfRunning) { for (;;) { Subscription a = upstream.get(); if (a == this || a == SubscriptionHelper.CANCELLED) { return false; } if (upstream.compareAndSet(a, SubscriptionHelper.CANCELLED)) { if (a != null) { a.cancel(); } countDown(); return true; } } }