goProject/.svn/pristine/b0/b0aeea527f1263e38bcb41b0a5b6c47ed2c03458.svn-base
2025-01-06 16:21:36 +08:00

41 lines
709 B
Plaintext

package coroutine_timer
// timerObj
// @description: 定时调度对象
type timerObj struct {
// id 调度id
id string
// tick 执行时间
tick int64
// excuteAction 执行方法
excuteAction func(interface{})
// paramObj 携带的参数
paramObj interface{}
// needCheckId 是否需要校验id
needCheckId bool
}
// newTimerObj
// @description: 构造调度对象
// parameter:
// @_id:id
// @t:调度时间
// @ea:调度方法
// @pm:调度参数
// return:
// @*timerObj:
func newTimerObj(_id string, t int64, ea func(interface{}), pm interface{}) *timerObj {
result := &timerObj{
id: _id,
tick: t,
excuteAction: ea,
paramObj: pm,
}
return result
}