Use two loops

This commit is contained in:
Alex Kotov 2023-01-08 01:29:12 +04:00
parent 51754e363a
commit 9d3ff4f1a2
No known key found for this signature in database
GPG key ID: 553C0EBBEB5D5F08

View file

@ -5,11 +5,14 @@ import asyncio
import aiogram as telegram import aiogram as telegram
import nio as matrix import nio as matrix
def main(): async def main():
asyncio.get_event_loop().run_until_complete(loop()) await asyncio.gather(matrix_loop(), telegram_loop())
async def loop(): async def matrix_loop():
print(123) print(123)
async def telegram_loop():
print(456)
if __name__ == '__main__': if __name__ == '__main__':
main() asyncio.run(main())