Exemplo n.º 1
0
 def on_recv(self, zmsg):
     """Got message from remote CC, send to client."""
     try:
         self.log.trace('')
         self.stat_inc('count')
         self.stat_inc('bytes', zmsg_size(zmsg))
         self.cclocal.send_multipart(zmsg)
     except:
         self.log.exception('crashed, dropping msg')
Exemplo n.º 2
0
Arquivo: proxy.py Projeto: postsql/cc
 def on_recv(self, zmsg):
     """Got message from remote CC, send to client."""
     try:
         self.log.trace('')
         self.stat_inc('count')
         self.stat_inc('bytes', zmsg_size(zmsg))
         self.cclocal.send_multipart(zmsg)
     except:
         self.log.exception('crashed, dropping msg')
Exemplo n.º 3
0
 def send_multipart(self, msg, *args, **kwargs):
     if self._send_queue.qsize() < self.qmaxsize:
         super(CCStream, self).send_multipart(msg, *args, **kwargs)
     else:
         stat_inc('count.dropped', 1)
         stat_inc('bytes.dropped', zmsg_size(msg))
Exemplo n.º 4
0
 def send_multipart (self, msg, *args, **kwargs):
     if self._send_queue.qsize() < self.qmaxsize:
         super(CCStream, self).send_multipart (msg, *args, **kwargs)
     else:
         stat_inc ('count.dropped', 1)
         stat_inc ('bytes.dropped', zmsg_size (msg))