@@ -1617,32 +1617,53 @@ public final Flowable<T> concatWith(SingleSource<? extends T> other) {
16171617 }
16181618
16191619 /**
1620- * Delays the emission of the success or error signal from the current Single by
1621- * the specified amount .
1620+ * Delays the emission of the success signal from the current Single by the specified amount.
1621+ * An error signal will not be delayed .
16221622 * <dl>
16231623 * <dt><b>Scheduler:</b></dt>
16241624 * <dd>{@code delay} operates by default on the {@code computation} {@link Scheduler}.</dd>
16251625 * </dl>
16261626 *
1627- * @param time the time amount to delay the signals
1627+ * @param time the amount of time the success signal should be delayed for
16281628 * @param unit the time unit
16291629 * @return the new Single instance
16301630 * @since 2.0
16311631 */
16321632 @ CheckReturnValue
16331633 @ SchedulerSupport (SchedulerSupport .COMPUTATION )
16341634 public final Single <T > delay (long time , TimeUnit unit ) {
1635- return delay (time , unit , Schedulers .computation ());
1635+ return delay (time , unit , Schedulers .computation (), false );
1636+ }
1637+
1638+ /**
1639+ * Delays the emission of the success or error signal from the current Single by the specified amount.
1640+ * <dl>
1641+ * <dt><b>Scheduler:</b></dt>
1642+ * <dd>{@code delay} operates by default on the {@code computation} {@link Scheduler}.</dd>
1643+ * </dl>
1644+ *
1645+ * @param time the amount of time the success or error signal should be delayed for
1646+ * @param unit the time unit
1647+ * @param delayError if true, both success and error signals are delayed. if false, only success signals are delayed.
1648+ * @return the new Single instance
1649+ * @since 2.1.5 - experimental
1650+ */
1651+ @ Experimental
1652+ @ CheckReturnValue
1653+ @ SchedulerSupport (SchedulerSupport .COMPUTATION )
1654+ public final Single <T > delay (long time , TimeUnit unit , boolean delayError ) {
1655+ return delay (time , unit , Schedulers .computation (), delayError );
16361656 }
16371657
16381658 /**
16391659 * Delays the emission of the success signal from the current Single by the specified amount.
1660+ * An error signal will not be delayed.
16401661 * <dl>
16411662 * <dt><b>Scheduler:</b></dt>
16421663 * <dd>you specify the {@link Scheduler} where the non-blocking wait and emission happens</dd>
16431664 * </dl>
16441665 *
1645- * @param time the time amount to delay the emission of the success signal
1666+ * @param time the amount of time the success signal should be delayed for
16461667 * @param unit the time unit
16471668 * @param scheduler the target scheduler to use for the non-blocking wait and emission
16481669 * @return the new Single instance
@@ -1654,9 +1675,33 @@ public final Single<T> delay(long time, TimeUnit unit) {
16541675 @ CheckReturnValue
16551676 @ SchedulerSupport (SchedulerSupport .CUSTOM )
16561677 public final Single <T > delay (final long time , final TimeUnit unit , final Scheduler scheduler ) {
1678+ return delay (time , unit , scheduler , false );
1679+ }
1680+
1681+ /**
1682+ * Delays the emission of the success or error signal from the current Single by the specified amount.
1683+ * <dl>
1684+ * <dt><b>Scheduler:</b></dt>
1685+ * <dd>you specify the {@link Scheduler} where the non-blocking wait and emission happens</dd>
1686+ * </dl>
1687+ *
1688+ * @param time the amount of time the success or error signal should be delayed for
1689+ * @param unit the time unit
1690+ * @param scheduler the target scheduler to use for the non-blocking wait and emission
1691+ * @param delayError if true, both success and error signals are delayed. if false, only success signals are delayed.
1692+ * @return the new Single instance
1693+ * @throws NullPointerException
1694+ * if unit is null, or
1695+ * if scheduler is null
1696+ * @since 2.1.5 - experimental
1697+ */
1698+ @ Experimental
1699+ @ CheckReturnValue
1700+ @ SchedulerSupport (SchedulerSupport .CUSTOM )
1701+ public final Single <T > delay (final long time , final TimeUnit unit , final Scheduler scheduler , boolean delayError ) {
16571702 ObjectHelper .requireNonNull (unit , "unit is null" );
16581703 ObjectHelper .requireNonNull (scheduler , "scheduler is null" );
1659- return RxJavaPlugins .onAssembly (new SingleDelay <T >(this , time , unit , scheduler ));
1704+ return RxJavaPlugins .onAssembly (new SingleDelay <T >(this , time , unit , scheduler , delayError ));
16601705 }
16611706
16621707 /**
0 commit comments