Exemplo n.º 1
0
    def push(self, data, queue=None):
        queue       = queue or self.input_queue
        retry_limit = self.retry_limit
        client      = self.client

        for i in range(retry_limit):
            result = client.set(queue, data)
        
            if result:
                return result

        raise RetryLimitExceeded()
Exemplo n.º 2
0
    def run(self):
        queue       = self.queue
        client      = self.client
        retry_limit = self.retry_limit

        for data in self.generator:
            result = False

            for i in range(retry_limit):
                result = client.set(queue, data)
                
                if result:
                    break

            if not result:
                raise RetryLimitExceeded()