Skip to content
gojuukaze edited this page Jul 9, 2021 · 3 revisions

Delay

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), // 本地队列大小
)

RunAfter

client.SetTaskCtl(client.RunAfter, 1*time.Second).Send("group2", "add_sub", 123, 44)

RunAt

runTime := time.Now().Add(1 * time.Second)
client.SetTaskCtl(client.RunAt, runTime).Send("group2", "add_sub", 123, 44)