##// END OF EJS Templates
use ROUTER/DEALER socket names instead of XREP/XREQ...
use ROUTER/DEALER socket names instead of XREP/XREQ This is principally a big find/replace, but also adjusts the import-check for pyzmq/zmq versions in IPython.zmq and IPython.parallel. XREP/XREQ are aliases for ROUTER/DEALER in 0MQ 2.x. These sockets continue to exist in 3.0 under the ROUTER/DEALER name only. The XREP/XREQ protocols change some in 3.0, and won't work properly with current IPython. It is likely that once 3.0 is stable (and pyzmq supports it better), we will want to move some sockets back to the *new* XREP/XREQ, but this PR should make IPython safe through libzmq-3.x.

File last commit:

r3603:600411fc
r4725:7bde2f38
Show More
log.py
23 lines | 687 B | text/x-python | PythonLexer
import logging
from logging import INFO, DEBUG, WARN, ERROR, FATAL
import zmq
from zmq.log.handlers import PUBHandler
class EnginePUBHandler(PUBHandler):
"""A simple PUBHandler subclass that sets root_topic"""
engine=None
def __init__(self, engine, *args, **kwargs):
PUBHandler.__init__(self,*args, **kwargs)
self.engine = engine
@property
def root_topic(self):
"""this is a property, in case the handler is created
before the engine gets registered with an id"""
if isinstance(getattr(self.engine, 'id', None), int):
return "engine.%i"%self.engine.id
else:
return "engine"