@Override public void onComplete() { countDown(); }
/** * Blockingly await indefinitely the termination of this Nono and return * the Throwable if this Nono terminated with an error, null * otherwise. * @return the Throwable error of the Nono, null if completed normally */ @SchedulerSupport(SchedulerSupport.NONE) public final Throwable blockingAwait() { if (this instanceof Callable) { try { ((Callable<?>)this).call(); return null; } catch (Throwable ex) { Exceptions.throwIfFatal(ex); return ex; } } NonoBlockingAwaitSubscriber s = new NonoBlockingAwaitSubscriber(); subscribe(s); return s.blockingAwait(); }
/** * Blockingly await indefinitely the termination of this Nono and return * the Throwable if this Nono terminated with an error, null * otherwise. * @return the Throwable error of the Nono, null if completed normally */ @SchedulerSupport(SchedulerSupport.NONE) public final Throwable blockingAwait() { if (this instanceof Callable) { try { ((Callable<?>)this).call(); return null; } catch (Throwable ex) { Exceptions.throwIfFatal(ex); return ex; } } NonoBlockingAwaitSubscriber s = new NonoBlockingAwaitSubscriber(); subscribe(s); return s.blockingAwait(); }
/** * Blockingly await for the given timeout the termination of this Nono and return * the Throwable if this Nono terminated with an error, null * otherwise. * @param timeout the timeout value * @param unit the time unit * @return the Throwable error of the Nono, null if completed normally */ @SchedulerSupport(SchedulerSupport.NONE) public final Throwable blockingAwait(long timeout, TimeUnit unit) { if (this instanceof Callable) { try { ((Callable<?>)this).call(); return null; } catch (Throwable ex) { Exceptions.throwIfFatal(ex); return ex; } } ObjectHelper.requireNonNull(unit, "unit is null"); NonoBlockingAwaitSubscriber s = new NonoBlockingAwaitSubscriber(); subscribe(s); return s.blockingAwait(timeout, unit); }
@Override public void onError(Throwable t) { error = t; countDown(); }
/** * Blockingly await for the given timeout the termination of this Nono and return * the Throwable if this Nono terminated with an error, null * otherwise. * @param timeout the timeout value * @param unit the time unit * @return the Throwable error of the Nono, null if completed normally */ @SchedulerSupport(SchedulerSupport.NONE) public final Throwable blockingAwait(long timeout, TimeUnit unit) { if (this instanceof Callable) { try { ((Callable<?>)this).call(); return null; } catch (Throwable ex) { Exceptions.throwIfFatal(ex); return ex; } } ObjectHelper.requireNonNull(unit, "unit is null"); NonoBlockingAwaitSubscriber s = new NonoBlockingAwaitSubscriber(); subscribe(s); return s.blockingAwait(timeout, unit); }
@Override public void onError(Throwable t) { error = t; countDown(); }
@Override public void onComplete() { countDown(); }