PeriodicTask(long firstStartInNanoseconds, @NonNull Runnable decoratedRun, long firstNowNanoseconds, @NonNull SequentialDisposable sd, long periodInNanoseconds) { this.decoratedRun = decoratedRun; this.sd = sd; this.periodInNanoseconds = periodInNanoseconds; lastNowNanoseconds = firstNowNanoseconds; startInNanoseconds = firstStartInNanoseconds; }
/** * Apply some calculation to the input value and return some other value. * @param t the input value * @return the output value * @throws Exception on error */ R apply(@NonNull T t) throws Exception; }
/** * Provides the SingleObserver with the means of cancelling (disposing) the * connection (channel) with the Single in both * synchronous (from within {@code onSubscribe(Disposable)} itself) and asynchronous manner. * @param d the Disposable instance whose {@link Disposable#dispose()} can * be called anytime to cancel the connection * @since 2.0 */ void onSubscribe(@NonNull Disposable d);
/** * Notifies the SingleObserver with a single item and that the {@link Single} has finished sending * push-based notifications. * <p> * The {@link Single} will not call this method if it calls {@link #onError}. * * @param t * the item emitted by the Single */ void onSuccess(@NonNull T t);
@Override @NonNull public String getMessage() { return message; }
/** * Returns the time unit of the contained time. * @return the time unit of the contained time */ @NonNull public TimeUnit unit() { return unit; }
/** * Signal a success value. * @param t the value, not null */ void onSuccess(@NonNull T t);
/** * Applies a function to the child Observer and returns a new parent Observer. * @param observer the child Observer instance * @return the parent Observer instance * @throws Exception on failure */ @NonNull Observer<? super Upstream> apply(@NonNull Observer<? super Downstream> observer) throws Exception; }
/** * Called for each Observer that subscribes. * @param e the safe emitter instance, never null * @throws Exception on error */ void subscribe(@NonNull ObservableEmitter<T> e) throws Exception; }
/** * Signal a Throwable exception. * @param error the Throwable to signal, not null */ void onError(@NonNull Throwable error);
/** * Wraps the {@code Throwable} before it * is signalled to the {@code RxJavaCommonPlugins.onError()} * handler as {@code OnErrorNotImplementedException}. * * @param e * the {@code Throwable} to signal; if null, a NullPointerException is constructed */ public OnErrorNotImplementedException(@NonNull Throwable e) { super(e != null ? e.getMessage() : null, e != null ? e : new NullPointerException()); } }
/** * Constructs a CompositeException with the given array of Throwables as the * list of suppressed exceptions. * @param exceptions the Throwables to have as initially suppressed exceptions * * @throws IllegalArgumentException if <code>exceptions</code> is empty. */ public CompositeException(@NonNull Throwable... exceptions) { this(exceptions == null ? Collections.singletonList(new NullPointerException("exceptions was null")) : Arrays.asList(exceptions)); }
@NonNull @Override public Disposable schedule(@NonNull final Runnable action, final long delayTime, @NonNull final TimeUnit unit) { // send a scheduled action to the actionQueue DelayedAction delayedAction = new DelayedAction(action, delayTime, unit); actionProcessor.onNext(delayedAction); return delayedAction; }