Smart Manoj
Smart Manoj

Reputation: 5851

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

Upvotes: 1

Views: 633

Answers (2)

Umesh Chaudhary
Umesh Chaudhary

Reputation: 411

Try this

import asyncio
from hypercorn.asyncio import serve

loop = client.loop
asyncio.set_event_loop(loop)

loop.run_until_complete(serve(app, config))

Upvotes: 1

pgjones
pgjones

Reputation: 7039

If you change to,

import asyncio
from hypercorn.asyncio import serve

loop.run_until_complete(serve(app, config)) 

you can fully control which loop Hypercorn uses to serve the app.

Upvotes: 1

Related Questions