Last active
August 29, 2015 14:19
-
-
Save asvetlov/b33fa82618767b9ed82f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def f(): | |
future = asyncio.Future() | |
future.set_result(5) | |
return future # yield from f() returns 5. | |
def g(): | |
future = asyncio.Future() | |
asyncio.get_event_loop.call_later(1, future.set_result, 5) | |
return future # yield from g() also returns 5 but 1 second later |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment