def multiproduce(): """ Run through all the producers in order """ if not producers: return [] callback = producers.pop(0) if isinstance(callback, types.FunctionType): try: value = callback() except RPCError: inst = sys.exc_info()[1] value = {'faultCode': inst.code, 'faultString': inst.text} if value is NOT_DONE_YET: # push it back in the front of the queue because we # need to finish the calls in requested order producers.insert(0, callback) return NOT_DONE_YET else: value = callback results.append(value) if producers: # only finish when all producers are finished return NOT_DONE_YET return results
def multiproduce(): """ Run through all the producers in order """ if not producers: return [] callback = producers.pop(0) if isinstance(callback, types.FunctionType): try: value = callback() except RPCError as inst: value = {'faultCode':inst.code, 'faultString':inst.text} if value is NOT_DONE_YET: # push it back in the front of the queue because we # need to finish the calls in requested order producers.insert(0, callback) return NOT_DONE_YET else: value = callback results.append(value) if producers: # only finish when all producers are finished return NOT_DONE_YET return results
def multiproduce(): """ Run through all the producers in order """ if not producers: return [] callback = producers.pop(0) if isinstance(callback, types.FunctionType): try: value = callback() except RPCError, inst: value = {"faultCode": inst.code, "faultString": inst.text} if value is NOT_DONE_YET: # push it back in the front of the queue because we # need to finish the calls in requested order producers.insert(0, callback) return NOT_DONE_YET
def multiproduce(): """ Run through all the producers in order """ if not producers: return [] callback = producers.pop(0) if isinstance(callback, types.FunctionType): try: value = callback() except RPCError, inst: value = {'faultCode':inst.code, 'faultString':inst.text} if value is NOT_DONE_YET: # push it back in the front of the queue because we # need to finish the calls in requested order producers.insert(0, callback) return NOT_DONE_YET