Exemplo n.º 1
0
    def __doit(self):
        if self.__triggered:
            return

        r = self.__result
        if r is not None:
            if r[0]:
                if self.__callback is not None:
                    self.__triggered = True
                    utils.safe(self.__callback, *(self.__callargs + r[1]),
                               **r[2])
            else:
                if self.__errback is not None:
                    self.__triggered = True
                    utils.safe(self.__errback, *(self.__errargs + r[1]),
                               **r[2])
Exemplo n.º 2
0
 def doit():
     try:
         r=utils.safe(func,*args,**kwds)
         if not isinstance(r,async.Deferred):
             a.run_bg_async(d.succeeded,r)
             return
         r.setCallback(bg_ok).setErrback(bg_failed)
Exemplo n.º 3
0
 def __trigger(self):
     while True:
         e = self.__dequeue()
         if e is None:
             break
         utils.safe(e[0],*e[1],**e[2])
Exemplo n.º 4
0
 def __service_async(self,evt):
     func = evt.e_func
     args = evt.e_args
     kwds = evt.e_kwds
     utils.safe(func,*args,**kwds)