toot/toot/asynch
Ivan Habunek bebd8e9023
wip
2023-06-26 14:55:27 +02:00
..
README.md wip 2023-06-26 14:55:27 +02:00
__init__.py wip 2023-06-26 14:55:27 +02:00
api.py wip 2023-06-26 14:55:27 +02:00
commands.py wip 2023-06-26 14:55:27 +02:00
entities.py wip 2023-06-26 14:55:27 +02:00
http.py wip 2023-06-26 14:55:27 +02:00
lazy_entities.py wip 2023-06-26 14:55:27 +02:00
speed_test.py wip 2023-06-26 14:55:27 +02:00

README.md

Toot Async Refactor

Moving to aiohttp for full async support + websockets for streaming.

Design goals:

  • keep the functional API design
  • not coupled with underlying library: requests/aiohttp/httpx
  • can easily read returned data decoded from json
  • can read returned data without it being decoded (currently not possible)
  • can read returned headers
  • raises an exception on error
  • asynchronous by default, with synchronous variants
  • rewrite TUI to use async functions instead of the current callback hell

To think about:

  • ability to reuse a aiohttp ClientSession without having to do so. toot's own Session object? are there performance issues if a new session is creted each time?
  • couple app and user into one "context" object to avoid having to pass two params for each fn?
  • further namespace CLI commands? for example "mute" can be applied to both a status and an account, having "toot status mute" and "toot account mute" would solve it at expense of verbosity and breaking BC. alternatively, "toot mute" could act on a status or account.
  • how to implement updating credentials via commandline? https://mastodon.example/api/v1/accounts/update_credentials

Unrelated to async refactor:

Yak shaving: