0
我正在尝试在python-rq
的工作任务内设置一个zmq
套接字。在rq worker中使用ZMQ
如果我创建context
任务函数内部:
def push(user, task_id, data):
"""Push message to `user` over websocket.
"""
ctx = zmq.Context()
pub = ctx.socket(zmq.PUB)
pub.connect('ipc:///tmp/message_flow_in')
pub.send(b"0 " + json.dumps({'username': user,
'id': task_id,
'data': data
}
).encode('utf-8')
)
的pub.send()
调用不起任何作用。
您是否尝试过使用**'tcp' ** - 基于**'flags = zmq.NOBLOCK' **的传输类进行诊断的相同场景(即使对于两个对等节点都托管相同的本地主机)? – user3666197