官术网_书友最值得收藏!

Observable.future()

RxJava Observables are much more robust and expressive than Futures, but if you have existing libraries that yield Futures, you can easily turn them into Observables via Observable.future():

    import io.reactivex.Observable;
import java.util.concurrent.Future;

public class Launcher {
public static void main(String[] args) {

Future<String> futureValue = ...;

Observable.fromFuture(futureValue)
.map(String::length)
.subscribe(System.out::println);
}
}
主站蜘蛛池模板: 白河县| 从化市| 郑州市| 托里县| 汝阳县| 泾川县| 牡丹江市| 名山县| 清涧县| 绥滨县| 错那县| 沧州市| 德兴市| 开远市| 辛集市| 龙游县| 武鸣县| 麻阳| 玛沁县| 门头沟区| 北安市| 泰安市| 旺苍县| 从化市| 招远市| 邢台县| 乌鲁木齐市| 连云港市| 固镇县| 银川市| 乳源| 永福县| 肥西县| 应城市| 溆浦县| 泗阳县| 罗平县| 宜州市| 沂水县| 邮箱| 和政县|