コード例 #1
0
 def __init__(self, async_func_gen=None, loop=None):
     """Pass a function that receives an event loop instance and a shutdown event,
     and returns an async function."""
     FuncThread.__init__(self, self.run_func, None)
     self.async_func_gen = async_func_gen
     self.loop = loop
     self.shutdown_event = None
コード例 #2
0
ファイル: kinesis_util.py プロジェクト: pinzon/localstack
 def __init__(self,
              events_file,
              callback,
              ready_mutex=None,
              fh_d_stream=None):
     FuncThread.__init__(self, self.retrieve_loop, None)
     self.events_file = events_file
     self.callback = callback
     self.ready_mutex = ready_mutex
     self.fh_d_stream = fh_d_stream
コード例 #3
0
 def __init__(self, params):
     FuncThread.__init__(self, self.start_reading, params)
     self.buffer = []
     self.params = params
     # number of lines that make up a single log entry
     self.buffer_size = 2
     # determine log level
     self.log_level = params.get("level")
     # get log subscribers
     self.log_subscribers = params.get("log_subscribers", [])
     if self.log_level is None:
         self.log_level = DEFAULT_KCL_LOG_LEVEL
     if self.log_level > 0:
         self.log_level = min(self.log_level, MAX_KCL_LOG_LEVEL)
         levels = OutputReaderThread.get_log_level_names(self.log_level)
         # regular expression to filter the printed output
         self.filter_regex = r".*(%s):.*" % ("|".join(levels))
         # create prefix and logger
         self.prefix = params.get("log_prefix") or "LOG"
         self.logger = logging.getLogger(self.prefix)
         self.logger.severe = self.logger.critical
         self.logger.fatal = self.logger.critical
         self.logger.setLevel(self.log_level)
コード例 #4
0
 def __init__(self):
     FuncThread.__init__(self, self.run_proxy, None)
     self.shutdown_event = None
     self.loop = None