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
While I understand the motivation, I think this can lead to confusing behaviour and could potentially mean spylib users have to eject from spylib entirely in certain situations.
I think each token containing its own AsyncClient instance would be very helpful. Maybe I want to do my own error handling, or implement different rate limit handling (round-robin on multiple tokens for instance). That way we could say here are the nice features we provide, but if you need anything custom just grab mytoken.client which has base_url, headers, etc. set up with sane defaults.
This then also leads into a discussion about who is responsible for calling aclose on the client...but that may be a discussion for another time 😜
An (contrived) example test where things don't work as expected:
Currently when using the admin api all stores (tokens) share the same global
httpx.AsyncClient
instance:spylib/spylib/admin_api.py
Line 81 in 63b4cf4
While I understand the motivation, I think this can lead to confusing behaviour and could potentially mean spylib users have to eject from spylib entirely in certain situations.
I think each token containing its own
AsyncClient
instance would be very helpful. Maybe I want to do my own error handling, or implement different rate limit handling (round-robin on multiple tokens for instance). That way we could say here are the nice features we provide, but if you need anything custom just grabmytoken.client
which hasbase_url
,headers
, etc. set up with sane defaults.This then also leads into a discussion about who is responsible for calling
aclose
on the client...but that may be a discussion for another time 😜An (contrived) example test where things don't work as expected:
spylib/tests/admin_api/test_credential_leak.py
Lines 7 to 45 in 2dd3fd8
The text was updated successfully, but these errors were encountered: