ihabunek / toot

toot - Mastodon CLI & TUI
GNU General Public License v3.0
1.16k stars 111 forks source link

Migrate from requests to an async http library #376

Open ihabunek opened 1 year ago

ihabunek commented 1 year ago

It's become pretty obvious that toot would benefit from using an async http library, and aiohttp seems a good candidate.

This would mostly benefit the TUI since the current approach with callbacks is very unwieldy. It would somewhat benefit the CLI since we'd be able to perform concurrent requests such as uploading several media files. Some commands also require several requests which could be paralelized.

Again, the cost is a pretty big rewrite.

davidbrochart commented 1 year ago

What about httpx, since only a client is needed?

Ousret commented 10 months ago

Hello there,

Sorry to barge in, There's an alternative you may be interested in. https://github.com/jawah/niquests

This is a drop-in-worthy replacement for Requests that ships with modern capabilities and allows you a painless transition. I can answer any concerns you may have.

ihabunek commented 10 months ago

Thanks, I'll check it out.