Beispiel #1
0
 def run(self):
     if self.expire_value \
        and time.time() - self.expire_start >= self.expire_value:
         self.failed('Event(%s) expired' % repr(self.action),
                     traceback=False)
         return
     if self.timeout_value \
        and time.time() - self.timeout_start < self.timeout_value:
         return
     if self.is_done:
         return
     if self.timeout_value:
         self.timeout_start = None
         self.timeout_value = None
     self.is_prevent_done = False
     try:
         args = {'args':[], 'kwargs': {}}
         if 'args' in self.message:
             args = self.message['args']
         self.result = do_strict_action(
             self.action, self.namespace, self, *args['args'],
             **args['kwargs'])
         self.is_first_run = False
     except Exception as error:
         self.failed(error, traceback=True)
     if self.message.get('no_reply'):
         self.done()
     elif self.is_prevent_done and not self.is_done:
         self.is_prevent_done = False
     elif not self.is_done:
         self.done()
Beispiel #2
0
 def run(self):
     result = do_strict_action(self.config['action'], 'client', self)
     if result is not None:
         print result
     """
Beispiel #3
0
 def action(*args, **kwargs):
     return do_strict_action(name, 'client', self.agent, *args, **kwargs)