1 Star 0 Fork 0

kzangv/gsf-fof

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
common.go 605 Bytes
Copy Edit Raw Blame History
kzangv authored 2023-02-23 10:22 . fixed
package cache
import (
"gitee.com/kzangv/gsf-fof/component/cron"
"gitee.com/kzangv/gsf-fof/component/cron/schedule"
)
const (
NegativeTimeoutPrefix = "t:"
PositiveDurationPrefix = "d:"
)
type PullHandle func() (interface{}, error)
type NewScheduleFunc func(int) schedule.Interface
func DefaultNewSchedule(sec int) schedule.Interface {
return schedule.NewDelaySchedule(sec)
}
type Cache struct {
cron *cron.Cron
handle NewScheduleFunc
}
func (c *Cache) Init(cron *cron.Cron, handle NewScheduleFunc) {
if handle == nil {
handle = DefaultNewSchedule
}
c.cron, c.handle = cron, handle
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/kzangv/gsf-fof.git
git@gitee.com:kzangv/gsf-fof.git
kzangv
gsf-fof
gsf-fof
v0.4.3

Search