forest Go sdk
go get github.com/busgo/cat
type EchoJob struct {
}
func (*EchoJob) execute(params string) (string, error) {
time.Sleep(time.Second * 5)
fmt.Println("参数:", params)
return "ok", nil
}
etcd, _ := NewEtcd([]string{"127.0.0.1:2379"}, time.Second*10)
forestClient := NewForestClient("trade", "127.0.0.1", etcd)
forestClient.PushJob("com.busgo.cat.job.EchoJob",&EchoJob{})
forestClient.Bootstrap()
=== RUN TestForestClient_Bootstrap
2019/12/24 17:41:51 the forest client success registry to:/forest/client/trade/clients/127.0.0.1
如有问题请联系 QQ:466862016 Email:[email protected] 讨论QQ群:806735002 欢迎指点拍砖!