From b72825d48ab86add415bba0c6eaa1b915423dd33 Mon Sep 17 00:00:00 2001 From: mikespook Date: Fri, 28 Dec 2012 17:15:23 +0800 Subject: [PATCH] testing file removed --- example/py/foobar.py | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100755 example/py/foobar.py diff --git a/example/py/foobar.py b/example/py/foobar.py deleted file mode 100755 index ac544f7..0000000 --- a/example/py/foobar.py +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/python - -import gearman - -def check_request_status(job_request): - if job_request.complete: - print "Job %s finished! Result: %s - %s" % (job_request.job.unique, job_request.state, job_request.result) - elif job_request.timed_out: - print "Job %s timed out!" % job_request.unique - elif job_request.state == JOB_UNKNOWN: - print "Job %s connection failed!" % job_request.unique - -def main(): - client = gearman.GearmanClient(['localhost:4730', 'otherhost:4730']) - for i in range(100000000): - try: - completed_job_request = client.submit_job("ToUpper", "arbitrary binary data") - check_request_status(completed_job_request) - except Exception as e: - print type(e) - - try: - completed_job_request = client.submit_job("SysInfo", "") - check_request_status(completed_job_request) - except Exception as e: - print type(e) - - try: - completed_job_request = client.submit_job("MemInfo", "") - check_request_status(completed_job_request) - except Exception as e: - print type(e) - -if __name__ == '__main__': - main() -