Created
September 21, 2011 22:30
-
-
Save harleyholt/1233506 to your computer and use it in GitHub Desktop.
Example Python Gearman Client (for python Gearman 2.0)
This file contains hidden or 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
from gearman import GearmanClient | |
# create a client that will connect to the Gearman server running on | |
# localhost. The array allows you to specify a set of job servers. | |
client = GearmanClient(['127.0.0.1']) | |
# Submit a synchronous job request to the job server and store the | |
# result. | |
# This runs the "echo" job on the argument "foo" | |
result = client.submit_job('echo', 'foo') | |
print 'Work complete with state %s' % result.state |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment