Skip to content
/ bus Public
forked from isgasho/bus-1

分布式任务调度平台 Go sdk

Notifications You must be signed in to change notification settings

ningge123/bus

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bus

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 欢迎指点拍砖!

About

分布式任务调度平台 Go sdk

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%