摘要: 线程模型 在EventBus3.0框架中执行线程的快速切换,通过ThreadMode来指定线程在哪个线程中执行; 在EventBus3.0框架线程模型有个PendingPost 类负责数据的传递; PendingPost 类中维护了3个字段,其中event为事件类的实例,subscription是监 阅读全文
posted @ 2017-04-26 16:13 飞蛾扑火 阅读(334) 评论(0) 推荐(0) 编辑
摘要: 事件分发 EventBus3.0的事件的分发时通过EventBus类中的post(粘性事件为postSticky)方法,post与postSticky的唯一区别就是,在postSticky内部首先会向EventBus类中的stickyEvents集合中添加事件类实例,然后在调用post方法;post 阅读全文
posted @ 2017-04-26 15:39 飞蛾扑火 阅读(234) 评论(0) 推荐(0) 编辑
摘要: 事件注册 在EventBus3.0框架中订阅者对事件进行注册/订阅是通过EventBus类中的register方法来实现的,register的方法参数就是我们的订阅者的实例; findSubscriberMethods 在register方法中首先获取订阅者的实例的类型,然后通过subscriber 阅读全文
posted @ 2017-04-26 10:57 飞蛾扑火 阅读(195) 评论(0) 推荐(0) 编辑