Example #1
0
 def __init__(self, size):
     LoggerMixIn.__init__(self)
     self._size = int(size)
     self._threads = []
     self._queue = Queue()
     self._queue_lock = RLock()
     self._task_counter = 0
     self._task_results = dict()
     self._stop_event = Event()
     self.log_signature = "threadpool "
Example #2
0
 def __init__(self, size):
     # type: (int) -> None
     LoggerMixIn.__init__(self)
     self._size = int(size)  # type: int
     self._threads = []  # type: List[Thread]
     self._queue = Queue()  # type: Queue
     self._queue_lock = RLock()  # type: RLock
     self._task_counter = 0  # type: int
     self._task_results = dict()  # type: Dict[int, Any]
     self._stop_event = Event()  # type: Event
     self.log_signature = "threadpool "  # type: str
Example #3
0
 def __init__(self, args):
     # type: (List[str]) -> None
     LoggerMixIn.__init__(self)
     self.log_signature = "navdoon.app "  # type: str
     self._config = dict()  # type: Dict[str, Any]
     self._args = args  # type: List[str]
     self._server = None  # type: Server
     self._run_lock = RLock()  # type: RLock
     self._shutdown_lock = RLock()  # type: RLock
     self._reload_lock = RLock()  # type: RLock
     self._configure(args)
Example #4
0
 def __init__(self, **kargs):
     AbstractCollector.__init__(self)
     LoggerMixIn.__init__(self)
     self.chunk_size = 8196
     self.socket_type = socket.SOCK_DGRAM
     self.socket_timeout = 1
     self.host = "127.0.0.1"
     self.port = self.__class__.default_port
     self.user = None
     self.group = None
     self.socket = None
     self._stop_queuing_requests = Event()
     self._queuing_requests = Event()
     self._shutdown = Event()
     self._should_shutdown = Event()
     self.configure(**kargs)
     self.log_signature = "collector.socket_server "
     self.num_worker_threads = 4
     self.worker_threads_limit = 128
Example #5
0
 def __init__(self, **kargs):
     # type: (**Dict[str, Any]) -> None
     AbstractCollector.__init__(self)
     LoggerMixIn.__init__(self)
     self.chunk_size = 8196  # type: int
     self.socket_type = socket.SOCK_DGRAM  # type: int
     self.socket_timeout = 1  # type: float
     self.host = '127.0.0.1'  # type: str
     self.port = DEFAULT_PORT  # type: int
     self.user = None  # type: int
     self.group = None  # type: int
     self.socket = None  # type: socket.socket
     self._stop_queuing_requests = Event()  # type: Event
     self._queuing_requests = Event()  # type: Event
     self._shutdown = Event()  # type: Event
     self._should_shutdown = Event()  # type: Event
     self.configure(**kargs)  # type: Dict[str, Any]
     self.log_signature = "collector.socket_server "  # type: str
     self.num_worker_threads = 4  # type: int
     self.worker_threads_limit = 128  # type: int