Ejemplo n.º 1
0
 def callAndFulfill(v):
     """
     A callback to be invoked if the "self promise"
     is fulfilled.
     """
     try:
         if aplus._isFunction(success):
             ret.fulfill(success(v))
         else:
             ret.fulfill(v)
     except Exception as e:
         Promise.last_exc_info = sys.exc_info()
         e.exc_info = sys.exc_info()
         ret.reject(e)
Ejemplo n.º 2
0
 def callAndFulfill(v):
     """
     A callback to be invoked if the "self promise"
     is fulfilled.
     """
     try:
         if aplus._isFunction(success):
             ret.fulfill(success(v))
         else:
             ret.fulfill(v)
     except Exception as e:
         Promise.last_exc_info = sys.exc_info()
         e.exc_info = sys.exc_info()
         ret.reject(e)
Ejemplo n.º 3
0
 def callAndReject(r):
     """
     A callback to be invoked if the "self promise"
     is rejected.
     """
     try:
         if aplus._isFunction(failure):
             ret.fulfill(failure(r))
         else:
             ret.reject(r)
     except Exception as e:
         Promise.last_exc_info = sys.exc_info()
         e.exc_info = sys.exc_info()
         ret.reject(e)
Ejemplo n.º 4
0
 def callAndReject(r):
     """
     A callback to be invoked if the "self promise"
     is rejected.
     """
     try:
         if aplus._isFunction(failure):
             ret.fulfill(failure(r))
         else:
             ret.reject(r)
     except Exception as e:
         Promise.last_exc_info = sys.exc_info()
         e.exc_info = sys.exc_info()
         ret.reject(e)