Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

new event loop asyncio

import asyncio

async def foo(loop):
    print('foo')
    loop.stop()

loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop) # <----
asyncio.ensure_future(foo(loop))
loop.run_forever()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #event #loop #asyncio
ADD COMMENT
Topic
Name
4+5 =