Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lupino/py3k-gearman

a python3 gearman client wraper on libgearman
https://github.com/lupino/py3k-gearman

Last synced: about 1 month ago
JSON representation

a python3 gearman client wraper on libgearman

Awesome Lists containing this project

README

        

A python3 gearman client wraper on libgearman

# client
>>> import gearman
>>> client = gearman.Client()
>>> client.add_servers('localhost:4730')
>>> client.do('echo', 'hello')

# worker
>>> import gearman
>>> worker = gearman.Worker()
>>> worker.add_servers('localhost:4730')
>>> def echo(job):
... print(job.workload)
... job.complete(job.workload)
>>> worker.add_func('echo', echo)
>>> worker.work()