Use two loops
This commit is contained in:
parent
51754e363a
commit
9d3ff4f1a2
11
mirrortea
11
mirrortea
|
@ -5,11 +5,14 @@ import asyncio
|
|||
import aiogram as telegram
|
||||
import nio as matrix
|
||||
|
||||
def main():
|
||||
asyncio.get_event_loop().run_until_complete(loop())
|
||||
async def main():
|
||||
await asyncio.gather(matrix_loop(), telegram_loop())
|
||||
|
||||
async def loop():
|
||||
async def matrix_loop():
|
||||
print(123)
|
||||
|
||||
async def telegram_loop():
|
||||
print(456)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
asyncio.run(main())
|
||||
|
|
Reference in a new issue