func Worker() { goworker.Register("CreateStack", w.CreateStack()) goworker.Register("DeleteStack", w.DeleteStack()) if err := goworker.Work(); err != nil { fmt.Println("Error:", err) } }
func main() { goworker.Register("SampleAddJobClass", addWorker) if err := goworker.Work(); err != nil { fmt.Println("Error:", err) } }
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) } }
func init() { mixpanelToken := os.Getenv("MIXPANEL_TOKEN") if mixpanelToken == "" { log.Fatal("MIXPANEL_TOKEN must be defined") } mp = mixpanel.NewMixpanel(mixpanelToken) goworker.Register("MixpanelTrackJob", mixpanelTrack) }
func main() { var ( reviewer = reviewerFunc(lintReviewer) queue = newResqueEnqueuer("high") ) goworker.Register("GoReviewJob", newGoReviewJob(reviewer, queue)) if err := goworker.Work(); err != nil { log.Error(err) } }
func init() { goworker.Register("Hello", helloWorker) total = 0 }
func init() { hw := newHivyWorker() goworker.Register(hw.channel, hw.forker) }