Skip to content

Instantly share code, notes, and snippets.

@azylman
Last active August 29, 2015 14:24
Show Gist options
  • Save azylman/04bd8cbd67e346b42f7c to your computer and use it in GitHub Desktop.
Save azylman/04bd8cbd67e346b42f7c to your computer and use it in GitHub Desktop.
Demonstration of a gearman server in go (https://github.com/azylman/gearman). All of the tools written to interact with Gearman still work.
$ echo -n "trolling" | gearman -p 4731 -f test
trolling
$ go run *.go -p 4731
Listening on :4731
$ gearcmd -name test -cmd echo -host localhost -port 4731
2015/07/13 16:39:32 Listening for job: test
2015/07/13 16:39:38 {"function":"test","job_data":"trolling","job_id":"0","level":"info","source":"gearcmd","title":"START"}
trolling
2015/07/13 16:39:38 {"function":"test","level":"info","source":"gearman","title":"success","type":"counter"}
2015/07/13 16:39:38 {"function":"test","job_data":"trolling","job_id":"0","level":"info","source":"gearcmd","success":true,"title":"END","type":"gauge","value":1}
2015/07/13 16:39:38 {"function":"test","level":"info","source":"gearcmd","title":"duration","type":"gauge","value":5}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment