##// END OF EJS Templates
Merge pull request #1262 from minrk/hbgil...
Merge pull request #1262 from minrk/hbgil Heartbeat no longer shares the app's Context Fixes in both the single and parallel kernels, preventing the heartbeat thread from sharing the zmq Context with the rest of the process. Non-copying sends require grabbing the GIL from the zmq io-thread in order to free memory, which could let Python get in the way of the heartbeat. Test script and notebook added to examples directory. closes #1260

File last commit:

r3603:600411fc
r5887:0d05c58e merge
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"