Beispiel #1
0
 def _process(self, op, *args, **kwargs):
     header, value = op.build(*args, **kwargs)
     try:
         r = None
         with self:
             # update header
             self.update_header(header)
             # send message synchronously
             _, cmd, v = self.send(header, value)
         operations._check_status(cmd)
         return op.parse(cmd,v)
     except Exception as e:
         return op.onError(e)
Beispiel #2
0
 def _process(self, op, *args, **kwargs):
     header, value = op.build(*args, **kwargs)
     try:
         r = None
         with self:
             # update header
             self.update_header(header)
             # send message synchronously
             _, cmd, v = self.send(header, value)
         operations._check_status(cmd)
         return op.parse(cmd, v)
     except Exception as e:
         return op.onError(e)
Beispiel #3
0
 def _process(self, op, *args, **kwargs):
     if 'no_ack' in kwargs:
         send_no_ack = True
         del kwargs['no_ack']
     else:
         send_no_ack = False
     header,value = op.build(*args, **kwargs)
     try:
         with self:
             # update header
             self.update_header(header)
             # send message synchronously
             if send_no_ack:
                 self.send_no_ack(header, value)
             else:
                 _, cmd, value = self.send(header, value)
         if send_no_ack:
             return None
         else:
             operations._check_status(cmd)
             return op.parse(cmd, value)
     except Exception as e:
         return op.onError(e)
 def _process(self, op, *args, **kwargs):
     if 'no_ack' in kwargs:
         send_no_ack = True
         del kwargs['no_ack']
     else:
         send_no_ack = False
     header, value = op.build(*args, **kwargs)
     try:
         with self:
             # update header
             self.update_header(header)
             # send message synchronously
             if send_no_ack:
                 self.send_no_ack(header, value)
             else:
                 _, cmd, value = self.send(header, value)
         if send_no_ack:
             return None
         else:
             operations._check_status(cmd)
             return op.parse(cmd, value)
     except Exception as e:
         return op.onError(e)