noc.core.threadpool

Module Contents

noc.core.threadpool.logger
noc.core.threadpool.DEFAULT_IDLE_TIMEOUT
noc.core.threadpool.DEFAULT_SHUTDOWN_TIMEOUT
class noc.core.threadpool.ThreadPoolExecutor(max_workers, idle_timeout=DEFAULT_IDLE_TIMEOUT, shutdown_timeout=DEFAULT_SHUTDOWN_TIMEOUT, name=None)

Bases: object

_put(self, item)
_get(self, timeout)
_qsize(self)
set_max_workers(self, max_workers)
stop_one_worker(self)
submit(self, fn, *args, **kwargs)
shutdown(self, sync=False)
worker(self)
may_submit(self)

Returns true when it possible to submit job without overflowing thread limits :return:

get_free_workers(self)

Returns amount of available workers for non-blocking submit :return:

apply_metrics(self, d)

Append threadpool metrics to dictionary d :param d: :return:

exception noc.core.threadpool.IdleTimeout

Bases: exceptions.Exception