pythonpython-asynciotelethonasgihypercorn

How to use telethon with hypercorn?


Telethon with quart

How to use telethon with hypercorn?

How to convert the following line

app.run(loop=client.loop)

In procfile, how to pass the loop

hypercorn file:app -k asyncio

Or how to use hypercorn api?

import asyncio
from hypercorn.asyncio import serve

asyncio.run(serve(app, config)) # value for config

Solution

  • Try this

    import asyncio
    from hypercorn.asyncio import serve
    
    loop = client.loop
    asyncio.set_event_loop(loop)
    
    loop.run_until_complete(serve(app, config))