bugfix
This commit is contained in:
parent
0aeb1df05f
commit
20e994c7f3
@ -41,9 +41,8 @@ async def zmq_subcribe(special_key: str, zmq_url='tcp://127.0.0.1:5555', callbac
|
|||||||
async def zmq_publish(key, content, zmq_url='tcp://127.0.0.1:5555'):
|
async def zmq_publish(key, content, zmq_url='tcp://127.0.0.1:5555'):
|
||||||
ctx = Context()
|
ctx = Context()
|
||||||
sock = ctx.socket(zmq.PUB)
|
sock = ctx.socket(zmq.PUB)
|
||||||
monitor = sock.get_monitor_socket()
|
|
||||||
sock.bind(zmq_url)
|
|
||||||
sock.setsockopt(zmq.LINGER, 1000)
|
sock.setsockopt(zmq.LINGER, 1000)
|
||||||
|
sock.bind(zmq_url)
|
||||||
await sock.send_multipart([key.encode(), content.encode()])
|
await sock.send_multipart([key.encode(), content.encode()])
|
||||||
sock.close()
|
sock.close()
|
||||||
ctx.term()
|
ctx.term()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user