Exemplo n.º 1
0
 def __init__(self, addr, tube, logger,
              low_limit=512, high_limit=1024, **kwargs):
     # pylint: disable=no-member
     super(BeanstalkdSender, self).__init__(addr, tube, logger, **kwargs)
     self.low_limit = low_limit
     self.high_limit = high_limit
     self.accepts_jobs = True
     self.nb_jobs = 0
     self.nb_jobs_lock = threading.Lock()
Exemplo n.º 2
0
 def __init__(self, conf, logger, volume, input_file=None, **kwargs):
     # pylint: disable=no-member
     self.conf = conf
     self.logger = logger or get_logger(conf)
     self.namespace = conf['namespace']
     self.volume = volume
     self.input_file = input_file
     self.nworkers = int_value(conf.get('workers'), self.DEFAULT_WORKERS)
     # counters
     self.lock_counters = threading.Lock()
     self.items_processed = 0
     self.errors = 0
     self.total_items_processed = 0
     self.total_errors = 0
     # report
     self.lock_report = threading.Lock()
     self.start_time = 0
     self.last_report = 0
     self.report_interval = int_value(conf.get('report_interval'),
                                      self.DEFAULT_REPORT_INTERVAL)
Exemplo n.º 3
0
 def __init__(self,
              addr,
              tube,
              logger,
              threshold=512,
              limit=1024,
              **kwargs):
     super(BeanstalkdSender, self).__init__(addr, tube, logger)
     self.threshold = threshold
     self.limit = limit
     self.fill = True
     self.nb_events = 0
     self.lock_nb_events = threading.Lock()