You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pystac only supports sync reads (from file or URL) and writes (to file). The desire to to also support an async API, so that users who wish to use this in an async context don't have to block or wrap calls in an executor.
file i/o is done via the open built-in
network i/o is done via urllib
Ideally, we would have as little duplicated code as possible, though the actual code for doing the i/o is pretty small (low tens of lines), and would easy to maintain if not shared, and the added complexity of contorting the code to work with or without the async keyword is probably not worth it.
File I/O
Continue to use built-io i/o for sync, and aiofiles library for async.
Network I/O
One approach to this is to use the api-compatible pairs of libraries for sync and async, e.g., requests / niquests (sync) and httpx (async) or urllib (sync, and currently used) and urllib3.future (async) (maybe? I don't know how similar urllib3 and urllib are?).
Or, just have a bit of duplicated-ish code and use urllib for sync (no external dependency) and httpx for async.
The text was updated successfully, but these errors were encountered:
This has come up before #690, #274 and always been considered not worth the effort with the current implementation of psytac. Probably something to consider for the pystac v2 rewrite: #1524
Filing this ticket here as a precursor to supporting async is pystac-client:
Currently:
open
built-inIdeally, we would have as little duplicated code as possible, though the actual code for doing the i/o is pretty small (low tens of lines), and would easy to maintain if not shared, and the added complexity of contorting the code to work with or without the async keyword is probably not worth it.
File I/O
Continue to use built-io i/o for sync, and aiofiles library for async.
Network I/O
One approach to this is to use the api-compatible pairs of libraries for sync and async, e.g., requests / niquests (sync) and httpx (async) or urllib (sync, and currently used) and urllib3.future (async) (maybe? I don't know how similar urllib3 and urllib are?).
Or, just have a bit of duplicated-ish code and use urllib for sync (no external dependency) and httpx for async.
The text was updated successfully, but these errors were encountered: