update from Atlas with major reorg
This commit is contained in:
17
attic/concurrency/timer.py
Normal file
17
attic/concurrency/timer.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import asyncio
|
||||
|
||||
@asyncio.coroutine
|
||||
def show_remaining():
|
||||
for remaining in range(5, 0, -1):
|
||||
print('Remaining: ', remaining)
|
||||
yield from asyncio.sleep(1)
|
||||
|
||||
def main():
|
||||
loop = asyncio.get_event_loop()
|
||||
try:
|
||||
loop.run_until_complete(show_remaining())
|
||||
finally:
|
||||
loop.close()
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user