Пример #1
0
 def process_message(self):
     message = invoker.read()
     
     if message:
         self.logger.info('Processing: %s' % message)
         self.delay = self.default_delay
         self._queue.put(message)
         self._queue.join()
     else:
         if self.delay > self.max_delay:
             self.delay = self.max_delay
         
         self.logger.debug('No messages, sleeping for: %s' % self.delay)
         
         time.sleep(self.delay)
         self.delay *= self.backoff_factor
Пример #2
0
    def process_message(self):
        message = invoker.read()

        if message:
            self.logger.info('Processing: %s' % message)
            self.delay = self.default_delay
            self._queue.put(message)
            self._queue.join()
        else:
            if self.delay > self.max_delay:
                self.delay = self.max_delay

            self.logger.debug('No messages, sleeping for: %s' % self.delay)

            time.sleep(self.delay)
            self.delay *= self.backoff_factor
 def process_message(self):
     if self._error.is_set():
         raise Exception, 'Error raised by worker thread, shutting down'
     
     message = invoker.read()
     
     if message:
         self.logger.info('Processing: %s' % message)
         self.delay = self.default_delay
         self._queue.put(message)
         self._queue.join()
     else:
         if self.delay > self.max_delay:
             self.delay = self.max_delay
         
         self.logger.info('No messages, sleeping for: %s' % self.delay)
         
         time.sleep(self.delay)
         self.delay *= self.backoff_factor
Пример #4
0
    def process_message(self):
        if self._error.is_set():
            raise Exception, 'Error raised by worker thread, shutting down'

        message = invoker.read()

        if message:
            self.logger.info('Processing: %s' % message)
            self.delay = self.default_delay
            self._queue.put(message)
            self._queue.join()
        else:
            if self.delay > self.max_delay:
                self.delay = self.max_delay

            self.logger.info('No messages, sleeping for: %s' % self.delay)

            time.sleep(self.delay)
            self.delay *= self.backoff_factor
Пример #5
0
    def process_message(self):
        message = invoker.read()

        if message:
            self._pool.acquire()

            self.logger.info('Processing: %s' % message)
            self.delay = self.default_delay

            # put the message into the queue for the scheduler
            self._queue.put(message)

            # wait to acknowledge receipt of the message
            self.logger.debug('Waiting for receipt of message')
            self._queue.join()
        else:
            if self.delay > self.max_delay:
                self.delay = self.max_delay

            self.logger.debug('No messages, sleeping for: %s' % self.delay)

            time.sleep(self.delay)
            self.delay *= self.backoff_factor
Пример #6
0
    def process_message(self):
        message = invoker.read()

        if message:
            self._pool.acquire()

            self.logger.info("Processing: %s" % message)
            self.delay = self.default_delay

            # put the message into the queue for the scheduler
            self._queue.put(message)

            # wait to acknowledge receipt of the message
            self.logger.debug("Waiting for receipt of message")
            self._queue.join()
        else:
            if self.delay > self.max_delay:
                self.delay = self.max_delay

            self.logger.debug("No messages, sleeping for: %s" % self.delay)

            time.sleep(self.delay)
            self.delay *= self.backoff_factor