Exemple #1
0
 def recv(self):
     chnl,msg = API.queue_bpop(
         self.chnls, 
         timeout=redis_conf.getint('channel_timeout',60)
     )
     if not chnl or not msg:    return
     return (chnl,msg)
Exemple #2
0
    def _recv(self):
        self.running = True
        log.msg('recv begin: %s' % self.chnls, log.DEBUG)

        while self.running:
            try:
                chnl, msg = API.queue_bpop(self.chnls, timeout=5)
            except redis.exceptions.ConnectionError, e:
                send_catch_log_deferred(signal=signals.ERROR, sender=self)
                self.stop()
            else:
                if not chnl or not msg: continue

                send_catch_log_deferred(signal=signals.RECV,
                                        sender=self,
                                        message=(chnl, msg))
Exemple #3
0
    def _recv(self):
        self.running = True
        log.msg('recv begin: %s'%self.chnls,log.DEBUG)

        while self.running:
            try:
                chnl,msg = API.queue_bpop(self.chnls, timeout=5)
            except  redis.exceptions.ConnectionError, e:
                send_catch_log_deferred( 
                    signal=signals.ERROR,
                    sender=self
                )            
                self.stop()
            else:            
                if not chnl or not msg:    continue

                send_catch_log_deferred( 
                    signal=signals.RECV,
                    sender=self,
                    message=(chnl,msg)
                )
Exemple #4
0
 def recv(self):
     chnl, msg = API.queue_bpop(self.chnls,
                                timeout=redis_conf.getint(
                                    'channel_timeout', 60))
     if not chnl or not msg: return
     return (chnl, msg)