Skip to content

Instantly share code, notes, and snippets.

@tomprince
Created March 10, 2016 20:04
Show Gist options
  • Save tomprince/abc0a42041613588c022 to your computer and use it in GitHub Desktop.
Save tomprince/abc0a42041613588c022 to your computer and use it in GitHub Desktop.
from __future__ import print_function
from twisted.internet.defer import Deferred
def make_request():
global resolver
print("making request")
resolver = Deferred()
return resolver
promise = make_request()
promise.addCallback(print, "stuff")
print("made requeset")
resolver.callback("result")
print("done")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment