示例#1
0
文件: runners.go 项目: tily/nimbus
func Worker() {
	goworker.Register("CreateStack", w.CreateStack())
	goworker.Register("DeleteStack", w.DeleteStack())
	if err := goworker.Work(); err != nil {
		fmt.Println("Error:", err)
	}
}
示例#2
0
func main() {
	goworker.Register("SampleAddJobClass", addWorker)

	if err := goworker.Work(); err != nil {
		fmt.Println("Error:", err)
	}

}
示例#3
0
文件: review_test.go 项目: houndci/go
func TestNewGoReviewJob(t *testing.T) {
	goReviewJob := newGoReviewJob(successReviewer, successEnqueuer)

	// compile error if signature is incorrect
	goworker.Register("GoReviewJob", goReviewJob)

	if err := goReviewJob("go_review", fixtureReviewJobArgs...); err != nil {
		t.Fatal(err)
	}
}
示例#4
0
func init() {
	mixpanelToken := os.Getenv("MIXPANEL_TOKEN")

	if mixpanelToken == "" {
		log.Fatal("MIXPANEL_TOKEN must be defined")
	}

	mp = mixpanel.NewMixpanel(mixpanelToken)

	goworker.Register("MixpanelTrackJob", mixpanelTrack)
}
示例#5
0
文件: main.go 项目: houndci/go
func main() {
	var (
		reviewer = reviewerFunc(lintReviewer)
		queue    = newResqueEnqueuer("high")
	)

	goworker.Register("GoReviewJob", newGoReviewJob(reviewer, queue))

	if err := goworker.Work(); err != nil {
		log.Error(err)
	}
}
示例#6
0
文件: hello_worker.go 项目: moul/junk
func init() {
	goworker.Register("Hello", helloWorker)
	total = 0
}
示例#7
0
func init() {
	hw := newHivyWorker()
	goworker.Register(hw.channel, hw.forker)
}