Remove deprecated PyZMQ call from Python ZMQ example
PyZMQ 17.0.0 has deprecated and removed zmq.asyncio.install() call with advice to use asyncio native run-loop instead of zmq specific. This caused exception when running the contrib/zmq/zmq_sub*.py examples. This commit simply follows the advice.
This commit is contained in:
Executable → Regular
+1
-1
@@ -38,7 +38,7 @@ port = 28332
|
||||
|
||||
class ZMQHandler():
|
||||
def __init__(self):
|
||||
self.loop = zmq.asyncio.install()
|
||||
self.loop = asyncio.get_event_loop()
|
||||
self.zmqContext = zmq.asyncio.Context()
|
||||
|
||||
self.zmqSubSocket = self.zmqContext.socket(zmq.SUB)
|
||||
|
||||
Executable → Regular
+1
-1
@@ -42,7 +42,7 @@ port = 28332
|
||||
|
||||
class ZMQHandler():
|
||||
def __init__(self):
|
||||
self.loop = zmq.asyncio.install()
|
||||
self.loop = asyncio.get_event_loop()
|
||||
self.zmqContext = zmq.asyncio.Context()
|
||||
|
||||
self.zmqSubSocket = self.zmqContext.socket(zmq.SUB)
|
||||
|
||||
Reference in New Issue
Block a user