我正在尝试使用 Python gearman 模块进行字符串反转的各种基本示例 我的本地主机已使用端口 4730 上的 IIS 设置但是我收到错误
raise UnknownCommandError(missing_callback_msg)
UnknownCommandError: Could not handle command: 'GEARMAN_COMMAND_TEXT_COMMAND' - {'raw_text': 'HTTP/1.1 400 Bad Request\r'}
客户端.py
import gearman
# setup client, connect to Gearman HQ
gm_client = gearman.GearmanClient(['localhost:4730'])
print 'Sending job...'
request = gm_client.submit_job('reverse', 'Hello World!')
print "Result: " + request.result
工人.py
import gearman
gm_worker = gearman.GearmanWorker(['localhost:4730'])
# define method to handled 'reverse' work
def task_listener_reverse(gearman_worker, gearman_job):
print 'reporting status'
return reversed(gearman_job.data)
gm_worker.set_client_id('your_worker_client_id_name')
gm_worker.register_task('reverse', task_listener_reverse)
gm_worker.work()
关于为什么会发生这种情况以及如何解决的任何建议