def __init__(self, config_file, poller_pool, annotator_pool):
super(PollerResource).__init__()
# Use process pollers as netsnmp is not behaving well using just threads
logging.debug('Starting poller pool ...')
self.poller_executor = futures.ProcessPoolExecutor(
max_workers=poller_pool)
# Start MIB resolver after processes above (or it will fork it as well)
logging.debug('Initializing MIB resolver ...')
import mibresolver
self.resolver = mibresolver
logging.debug('Starting annotation pool ...')
# .. but annotators are just CPU, so use lightweight threads.
self.annotator_executor = futures.ThreadPoolExecutor(
max_workers=annotator_pool)
self.config_file = config_file
评论列表
文章目录