##// END OF EJS Templates
stop channels in background threads...
stop channels in background threads stop_channels() *must* be called, to prevent fd count rising, but stop_channels waits up to 0.2s up to 4 times, and it shouldn't get in the way of the UI. This just calls stop_channels in a thread, to protect UI responsiveness.

File last commit:

r3603:600411fc
r5142:aec00347
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"