|
@@ -13,18 +13,28 @@ var (
|
|
|
rpc_quit = "executor.close"
|
|
rpc_quit = "executor.close"
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
|
|
+// 串行执行
|
|
|
func (c *MQTTCoupler) needSerialize(method string) bool {
|
|
func (c *MQTTCoupler) needSerialize(method string) bool {
|
|
|
- if method == rpc_ping || method == rpc_stop {
|
|
|
|
|
|
|
+ switch method {
|
|
|
|
|
+ case rpc_ping, rpc_stop:
|
|
|
return false
|
|
return false
|
|
|
|
|
+ case rpc_exec, rpc_quit:
|
|
|
|
|
+ return true
|
|
|
|
|
+ default:
|
|
|
|
|
+ return true
|
|
|
}
|
|
}
|
|
|
- return true
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// 超时结束
|
|
|
func (c *MQTTCoupler) needTimeoutEnd(method string) bool {
|
|
func (c *MQTTCoupler) needTimeoutEnd(method string) bool {
|
|
|
- if method == rpc_ping || method == rpc_stop || method == rpc_quit {
|
|
|
|
|
|
|
+ switch method {
|
|
|
|
|
+ case rpc_exec:
|
|
|
|
|
+ return false
|
|
|
|
|
+ case rpc_ping, rpc_stop, rpc_quit:
|
|
|
|
|
+ return true
|
|
|
|
|
+ default:
|
|
|
return true
|
|
return true
|
|
|
}
|
|
}
|
|
|
- return false
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 心跳检测
|
|
// 心跳检测
|