MockActiveTappiesImpl.java 文件源码

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

项目:TappyBLE 作者:
public MockActiveTappiesImpl(Scheduler ioScheduler) {
    this.ioScheduler = ioScheduler;
    tappyObs = Observable.create(new Observable.OnSubscribe<Set<TappyBleDeviceDefinition>>() {

        @Override
        public void call(final Subscriber<? super Set<TappyBleDeviceDefinition>> subscriber) {
            final ActiveTappiesListener listener = new ActiveTappiesListener() {
                @Override
                public void onUpdatedList(Set<TappyBleDeviceDefinition> tappies) {
                    subscriber.onNext(tappies);
                }
            };

            MockActiveTappiesImpl.this.registerListener(listener);

            subscriber.add(Subscriptions.create(new Action0() {
                @Override
                public void call() {
                    MockActiveTappiesImpl.this.unregisterListener(listener);
                }
            }));

            subscriber.onNext(tappyList);
        }
    }).subscribeOn(ioScheduler);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号