Created
January 25, 2012 18:09
-
-
Save hjr3/1677655 to your computer and use it in GitHub Desktop.
Examples of using the gearman tool to create boilerplate clients and workers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gearman client that sends no data to the "ping" function | |
gearman -f ping -s | |
# gearman client that sends the string "pong" to the "ping" function | |
echo "pong" | gearman -f ping | |
# gearman client that sends a json string to the "process" function | |
echo '{"order":4985343}' | gearman -f process | |
# gearman client that reads data from a order.json file | |
# and sends to the "process" function | |
gearman -f ping < order.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gearman worker listening for "resize" function | |
gearman -w -f "resize" | |
# gearman worker listening for "generate_po" function and exiting after 5 jobs | |
gearman -w -f generate_po -c 5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment