Skip to content
gojuukaze edited this page Jul 13, 2020 · 1 revision

trigger retry

  • use panic
func add(a, b int){
    panic("xx")
}
  • use TaskCtl
func add(ctl *controller.TaskCtl,a, b int){
    ctl.Retry(errors.New("xx"))
    return
}

set retry count

Default retry count is 3

  • in client
client.SetTaskCtl(client.RetryCount, 5).Send("group1", "retry", 123, 44)

disable retry

  • in server
func add(ctl *controller.TaskCtl,a, b int){
    ctl.SetRetryCount(0)
    return
}
  • in client
client.SetTaskCtl(client.RetryCount, 0).Send("group1", "retry", 123, 44)