Skip to content

Instantly share code, notes, and snippets.

@schleppy
Created May 1, 2012 22:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schleppy/2572052 to your computer and use it in GitHub Desktop.
Save schleppy/2572052 to your computer and use it in GitHub Desktop.
def main_method(arg1, arg2):
d = long_method_1(arg1)
d2 = long_method_2(arg2)
d_list = defer.gatherResults([d, d2])
d_list.addCallback(compose_results);
return d_list
def long_method_1(arg):
deferred = getPage('blah')
return deferred1
def long_method_2(arg):
deferred = getPage('blah2')
return deferred2
def compose_results(results):
do composition
return composition
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment