Skip to content

Commit 7295e82

Browse files
committed
remove remaining references to deprecated XREP/XREQ names
only one line of actual code is changed. these names have been removed from the next libzmq release, and will presumably be removed from pyzmq someday.
1 parent 7f3891a commit 7295e82

11 files changed

Lines changed: 25 additions & 25 deletions

File tree

IPython/frontend/consoleapp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,11 @@ class IPythonConsoleApp(Configurable):
166166
hb_port = Int(0, config=True,
167167
help="set the heartbeat port [default: random]")
168168
shell_port = Int(0, config=True,
169-
help="set the shell (XREP) port [default: random]")
169+
help="set the shell (ROUTER) port [default: random]")
170170
iopub_port = Int(0, config=True,
171171
help="set the iopub (PUB) port [default: random]")
172172
stdin_port = Int(0, config=True,
173-
help="set the stdin (XREQ) port [default: random]")
173+
help="set the stdin (DEALER) port [default: random]")
174174
connection_file = Unicode('', config=True,
175175
help="""JSON file in which to store connection info [default: kernel-<pid>.json]
176176

IPython/frontend/html/notebook/kernelmanager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def create_iopub_stream(self, kernel_id):
193193
def create_shell_stream(self, kernel_id):
194194
ip = self.get_kernel_ip(kernel_id)
195195
ports = self.get_kernel_ports(kernel_id)
196-
shell_stream = self.create_connected_stream(ip, ports['shell_port'], zmq.XREQ)
196+
shell_stream = self.create_connected_stream(ip, ports['shell_port'], zmq.DEALER)
197197
return shell_stream
198198

199199
def create_hb_stream(self, kernel_id):

IPython/frontend/html/notebook/zmqhttp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def get(self, *args, **kwargs):
7676
self.get_stream().on_recv(self._handle_msgs)
7777

7878

79-
class ZMQXReqHandler(ZMQHandler):
79+
class ZMQDealerHandler(ZMQHandler):
8080

8181
SUPPORTED_METHODS = ("POST",)
8282

IPython/parallel/apps/ipcontrollerapp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ def init_schedulers(self):
365365
scheme = TaskScheduler.scheme_name.get_default_value()
366366
# Task Queue (in a Process)
367367
if scheme == 'pure':
368-
self.log.warn("task::using pure XREQ Task scheduler")
368+
self.log.warn("task::using pure DEALER Task scheduler")
369369
q = mq(zmq.ROUTER, zmq.DEALER, zmq.PUB, b'intask', b'outtask')
370370
# q.setsockopt_out(zmq.HWM, hub.hwm)
371371
q.bind_in(hub.client_info['task'][1])

IPython/parallel/controller/heartmonitor.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22
"""
3-
A multi-heart Heartbeat system using PUB and XREP sockets. pings are sent out on the PUB,
4-
and hearts are tracked based on their XREQ identities.
3+
A multi-heart Heartbeat system using PUB and ROUTER sockets. pings are sent out on the PUB,
4+
and hearts are tracked based on their DEALER identities.
55
66
Authors:
77
@@ -34,9 +34,9 @@ class Heart(object):
3434
Device model for responding to heartbeats.
3535
3636
It simply builds a threadsafe zmq.FORWARDER Device, defaulting to using
37-
SUB/XREQ for in/out.
37+
SUB/DEALER for in/out.
3838
39-
You can specify the XREQ's IDENTITY via the optional heart_id argument."""
39+
You can specify the DEALER's IDENTITY via the optional heart_id argument."""
4040
device=None
4141
id=None
4242
def __init__(self, in_addr, out_addr, in_type=zmq.SUB, out_type=zmq.DEALER, heart_id=None):
@@ -62,7 +62,7 @@ def start(self):
6262
class HeartMonitor(LoggingConfigurable):
6363
"""A basic HeartMonitor class
6464
pingstream: a PUB stream
65-
pongstream: an XREP stream
65+
pongstream: an ROUTER stream
6666
period: the period of the heartbeat in milliseconds"""
6767

6868
period = Integer(3000, config=True,
@@ -171,11 +171,11 @@ def handle_pong(self, msg):
171171
context = zmq.Context()
172172
pub = context.socket(zmq.PUB)
173173
pub.bind('tcp://127.0.0.1:5555')
174-
xrep = context.socket(zmq.ROUTER)
175-
xrep.bind('tcp://127.0.0.1:5556')
174+
router = context.socket(zmq.ROUTER)
175+
router.bind('tcp://127.0.0.1:5556')
176176

177177
outstream = zmqstream.ZMQStream(pub, loop)
178-
instream = zmqstream.ZMQStream(xrep, loop)
178+
instream = zmqstream.ZMQStream(router, loop)
179179

180180
hb = HeartMonitor(loop, outstream, instream)
181181

IPython/parallel/controller/hub.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ class EngineConnector(HasTraits):
108108
Attributes are:
109109
id (int): engine ID
110110
uuid (str): uuid (unused?)
111-
queue (str): identity of queue's XREQ socket
112-
registration (str): identity of registration XREQ socket
113-
heartbeat (str): identity of heartbeat XREQ socket
111+
queue (str): identity of queue's DEALER socket
112+
registration (str): identity of registration DEALER socket
113+
heartbeat (str): identity of heartbeat DEALER socket
114114
"""
115115
id=Integer(0)
116116
queue=CBytes()
@@ -124,7 +124,7 @@ class HubFactory(RegistrationFactory):
124124

125125
# port-pairs for monitoredqueues:
126126
hb = Tuple(Integer,Integer,config=True,
127-
help="""XREQ/SUB Port pair for Engine heartbeats""")
127+
help="""DEALER/SUB Port pair for Engine heartbeats""")
128128
def _hb_default(self):
129129
return tuple(util.select_random_ports(2))
130130

@@ -309,7 +309,7 @@ class Hub(SessionFactory):
309309
session: Session object
310310
<removed> context: zmq context for creating new connections (?)
311311
queue: ZMQStream for monitoring the command queue (SUB)
312-
query: ZMQStream for engine registration and client queries requests (XREP)
312+
query: ZMQStream for engine registration and client queries requests (ROUTER)
313313
heartbeat: HeartMonitor object checking the pulse of the engines
314314
notifier: ZMQStream for broadcasting engine registration changes (PUB)
315315
db: connection to db for out of memory logging of commands

IPython/parallel/controller/scheduler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ def handle_result(self, idents, parent, raw_msg, success=True):
609609
# first, relay result to client
610610
engine = idents[0]
611611
client = idents[1]
612-
# swap_ids for XREP-XREP mirror
612+
# swap_ids for ROUTER-ROUTER mirror
613613
raw_msg[:2] = [client,engine]
614614
# print (map(str, raw_msg[:4]))
615615
self.client_stream.send_multipart(raw_msg, copy=False)

IPython/zmq/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ def install():
3333

3434
# fix missing DEALER/ROUTER aliases in pyzmq < 2.1.9
3535
if not hasattr(zmq, 'DEALER'):
36-
zmq.DEALER = zmq.XREQ
36+
zmq.DEALER = zmq.DEALER
3737
if not hasattr(zmq, 'ROUTER'):
38-
zmq.ROUTER = zmq.XREP
38+
zmq.ROUTER = zmq.ROUTER
3939

4040
# fallback on stdlib json if jsonlib is selected, because jsonlib breaks things.
4141
# jsonlib support is removed from pyzmq >= 2.2.0

IPython/zmq/entry_point.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def write_connection_file(fname=None, shell_port=0, iopub_port=0, stdin_port=0,
3131
The path to the file to write
3232
3333
shell_port : int, optional
34-
The port to use for XREP channel.
34+
The port to use for ROUTER channel.
3535
3636
iopub_port : int, optional
3737
The port to use for the SUB channel.

IPython/zmq/kernelapp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ def _parent_appname_changed(self, name, old, new):
112112
ip = Unicode(LOCALHOST, config=True,
113113
help="Set the IP or interface on which the kernel will listen.")
114114
hb_port = Integer(0, config=True, help="set the heartbeat port [default: random]")
115-
shell_port = Integer(0, config=True, help="set the shell (XREP) port [default: random]")
115+
shell_port = Integer(0, config=True, help="set the shell (ROUTER) port [default: random]")
116116
iopub_port = Integer(0, config=True, help="set the iopub (PUB) port [default: random]")
117-
stdin_port = Integer(0, config=True, help="set the stdin (XREQ) port [default: random]")
117+
stdin_port = Integer(0, config=True, help="set the stdin (DEALER) port [default: random]")
118118
connection_file = Unicode('', config=True,
119119
help="""JSON file in which to store connection info [default: kernel-<pid>.json]
120120

0 commit comments

Comments
 (0)