标题:
Picasso使用简介及分析(5)
[打印本页]
作者:
look_w
时间:
2019-2-18 19:54
标题:
Picasso使用简介及分析(5)
5. Dispatcher(任务分发器)会通过Handler来提交任务,然后交由Dispatcher的performSubmit方法来执行
void performSubmit(Action action, boolean dismissFailed) {
if (pausedTags.contains(action.getTag())) {
pausedActions.put(action.getTarget(), action);
...
return;
}
//查看是否有对应url的缓存的hunter
//BitmapHunter的简介请看文章开始的介绍
BitmapHunter hunter = hunterMap.get(action.getKey());
if (hunter != null) {
hunter.attach(action);
return;
}
if (service.isShutdown()) {
...
return;
}
hunter = forRequest(action.getPicasso(), this, cache, stats, action);
//提交任务到线程池
hunter.future = service.submit(hunter);
//将runnable缓存在map集合中
hunterMap.put(action.getKey(), hunter);
if (dismissFailed) {
failedActions.remove(action.getTarget());
}
...
}
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/)
Powered by Discuz! 7.0.0