RxJava2 Flowable delay delaySubscription(辅助操作符)

本文详细介绍了RxJava2中Flowable的delay操作符,包括其接口、图解、测试用例及延迟3秒的效果。同时提到了delaySubscription操作符,它用于延迟订阅源Publisher,对于冷Publisher会延迟数据接收,而热Publisher则可能导致数据丢失。
摘要由CSDN通过智能技术生成

delay (辅助操作符)

目录

1 dealy接口 

2 delay图解

3 delay测试用例

4 delay测试用例说明

5 delaySubscription操作符


 

 

1 dealy接口 

<U> Flowable<T>

delay(Function<? super T,? extends Publisher<U>> itemDelayIndicator)

Returns a Flowable that delays the emissions of the source Publisher via another Publisher on a per-item basis.

返回一个Flowable,它基于每个项目通过另一个Publisher延迟源Publisher的排放。

Flowable<T>

delay(long delay, TimeUnit unit)

Returns a Flowable that emits the items emitted by the source Publisher shifted forward in time by a specified delay.

返回一个Flowable,它发出由源Publisher按时间向前移动指定延迟的项。

Flowable<T>

delay(long delay, TimeUnit unit, boolean delayError)

Returns a Flowable that emits the items emitted by the source Publisher shifted forward in time by a specified delay.

返回一个Flowable,它发出由源Publisher按时间向前移动指定延迟的项(并设置是否延迟error处理)

Flowable<T>

delay(long delay, TimeUnit unit, Scheduler scheduler)

Returns a Flowable that emits the items emitted by the source Publisher shifted forward in time by a specified delay.

返回一个Flowable,它发出由源Publisher按时间向前移动指定延迟的项。(延迟策略可以自己自定义Scheduler

Flowable<T>

delay(long delay, TimeUnit unit, Schedu

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值