Пример #1
0
    def call(self, service, method, *args, **kwargs):
        """ Use the following process to call the method:
    - obtain a worker reference
    - call the method in there
    - park the deferred; return a new deferred to the caller of this method
    - if error, reset and try again.
    - if no error, put result onto return deferred.
    
The coreio call method will receive a deferred OR a NoWorkersError
will be raised.
"""
        rd = Deferred()
        rd._peloton_loopcount = 0 # used in _call
        self._call(rd, service, method, args, kwargs)
        return rd