-
Notifications
You must be signed in to change notification settings - Fork 53
Open
Description
- ListenerQueue中,
pop
,push
方法 pop用了synchronized锁,push没有,实际上callBackQueue使用的ConcurrentHashMap
是线程安全的
//以前是TimerTask处理方式
private void startTimer() {
if(!stopFlag && hasTask == false) {
hasTask = true;
timerHandler.postDelayed(new Runnable() {
@Override
public void run() {
timerImpl();
hasTask = false;
startTimer();
}
}, 5 * 1000);
}
}
延时5秒的定时任务会导致极端情况下,超时时间会延长5秒
- netty可以升级了
- 心跳不建议定时发送,而是监听channel的active状态
Metadata
Metadata
Assignees
Labels
No labels