Skip to content

Instantly share code, notes, and snippets.

@harleyholt
Created September 21, 2011 22:30
Show Gist options
  • Save harleyholt/1233506 to your computer and use it in GitHub Desktop.
Save harleyholt/1233506 to your computer and use it in GitHub Desktop.
Example Python Gearman Client (for python Gearman 2.0)
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