SHARE
TWEET

Untitled

a guest Jul 19th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. func main() {
  2.   client, err := zbc.NewZBClient("localhost:26500")
  3.   jobWorker := client.NewJobWorker().JobType("my-service-task").Handler(handleJob).Open()
  4.   defer jobWorker.Close()
  5.   jobWorker.AwaitClose()
  6. }
  7.  
  8. func handleJob(client worker.JobClient, job entities.Job) {
  9.   // here: business logic that is executed with every job
  10.   log.Println(job)
  11.   // and let the workflow engine know we are done
  12.   request, err := client.NewCompleteJobCommand().JobKey(jobKey)
  13.   request.Send()
  14. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top