SoundServiceImpl.java 文件源码

java
阅读 23 收藏 0 点赞 0 评论 0

项目:openwebnet-android 作者:
private Func1<SoundModel, Observable<SoundModel>> requestSound(
    Func3<String, SoundSystem.Type, SoundSystem.Source, SoundSystem> request,
    Func2<OpenSession, SoundModel, SoundModel> handler) {

    return sound -> commonService.findClient(sound.getGatewayUuid())
        .send(request.call(sound.getWhere(), sound.getSoundSystemType(), sound.getSoundSystemSource()))
        .subscribeOn(Schedulers.io())
        .observeOn(AndroidSchedulers.mainThread())
        .map(openSession -> handler.call(openSession, sound))
        .onErrorReturn(throwable -> {
            log.warn("sound={} | failing request={}", sound.getUuid(),
                request.call(sound.getWhere(), sound.getSoundSystemType(), sound.getSoundSystemSource()).getValue());
            // unreadable status
            return sound;
        });
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号