-
Notifications
You must be signed in to change notification settings - Fork 36
delay
gojuukaze edited this page Jul 9, 2021
·
3 revisions
Run server with enableDelayServer=true
ser := ytask.Server.NewServer(...)
ser.Run("group", 10, true)
or use config (v2.4+)
config:=config.NewConfig(
config.EnableDelayServer(true),
config.delayServerQueueSize(50), // 本地队列大小
)
client.SetTaskCtl(client.RunAfter, 1*time.Second).Send("group2", "add_sub", 123, 44)
runTime := time.Now().Add(1 * time.Second)
client.SetTaskCtl(client.RunAt, runTime).Send("group2", "add_sub", 123, 44)