web client: add async API
We want to add an async API to the web client, in order to avoid blocking in async contexts.
One of these contexts is going to be the FUSE filesystem (swh-fuse#1926 (closed)), but it's generally a useful thing to increase throughput when using the web client in client code.
We do not want to break the current sync API, nor force all users of the web client to go down the asyncio rabbit hole.
So we should migrate the current feature to low-level async code, which will be exposed as a new API (maybe a new swh.web.client.async
module?), and then forward port the current sync API to a set of wrappers (return asyncio.run()
) sitting on top of the async API.
Migrated from T2635 (view on Phabricator)