def __init__(self, func, pool_size=4, timeout=None):
# The signal handler for the consumer exists only in the parent
# process. If we don't give children their own noop signal handler,
# any signal propagated to them by the parent will cause them to throw
# an exception and terminate.
super(ProcessPoolWorker, self).__init__(func, pool_size=pool_size,
timeout=timeout)
self.pool = pool.Pool(processes=pool_size,
initializer=init_process_pool)
self.logger = get_logger(__name__)
评论列表
文章目录