import asyncio @asyncio.coroutine def do_work(): asyncio.sleep(0) return 1 @asyncio.coroutine def main(): while True: x = yield from asyncio.wait_for(do_work(), 3600) loop = asyncio.get_event_loop() x = asyncio.async(main()) def dummy(): print('dummy') loop.call_later(3000, dummy) try: loop.run_forever() except: pass finally: loop.close()