@@ -1617,32 +1617,53 @@ public final Flowable<T> concatWith(SingleSource<? extends T> other) {
1617
1617
}
1618
1618
1619
1619
/**
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 .
1622
1622
* <dl>
1623
1623
* <dt><b>Scheduler:</b></dt>
1624
1624
* <dd>{@code delay} operates by default on the {@code computation} {@link Scheduler}.</dd>
1625
1625
* </dl>
1626
1626
*
1627
- * @param time the time amount to delay the signals
1627
+ * @param time the amount of time the success signal should be delayed for
1628
1628
* @param unit the time unit
1629
1629
* @return the new Single instance
1630
1630
* @since 2.0
1631
1631
*/
1632
1632
@ CheckReturnValue
1633
1633
@ SchedulerSupport (SchedulerSupport .COMPUTATION )
1634
1634
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 );
1636
1656
}
1637
1657
1638
1658
/**
1639
1659
* Delays the emission of the success signal from the current Single by the specified amount.
1660
+ * An error signal will not be delayed.
1640
1661
* <dl>
1641
1662
* <dt><b>Scheduler:</b></dt>
1642
1663
* <dd>you specify the {@link Scheduler} where the non-blocking wait and emission happens</dd>
1643
1664
* </dl>
1644
1665
*
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
1646
1667
* @param unit the time unit
1647
1668
* @param scheduler the target scheduler to use for the non-blocking wait and emission
1648
1669
* @return the new Single instance
@@ -1654,9 +1675,33 @@ public final Single<T> delay(long time, TimeUnit unit) {
1654
1675
@ CheckReturnValue
1655
1676
@ SchedulerSupport (SchedulerSupport .CUSTOM )
1656
1677
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 ) {
1657
1702
ObjectHelper .requireNonNull (unit , "unit is null" );
1658
1703
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 ));
1660
1705
}
1661
1706
1662
1707
/**
0 commit comments