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
When doing a lot of requests to the same endpoint, it is probably helpful for runtime (and also is "cheaper" on OA server side, I guess) not to create a new connection each time but re-use Session object.
Please correct me if I am wrong here.
I also have done minor changes to test that - it seems to work faster (and hopefully "cheaper" on server side), so i can do a small PR.
The text was updated successfully, but these errors were encountered:
Hello @cryoff ,
thanks for your issue. I was already thinking about using sessions but haven't had time yet to look deeper into it.
As far as I understand it, they may be helpful for doing multiple requests but would be a bit over the top for few or single requests since they are costly to create --> should not be the default.
To me the main questions are where to put the session and when to use it?
About Where : Maybe the session could hold the values that the api_caller currently holds and be stored there.
About When: it's hard to say if a method call will require a lot of requests, I think. In the end the user should decide if it makes sense to create a session for their use case or not, so the best place may be when creating the openalex object, there could be a boolean that decides if a session will be created.
Does that make sense to you or did you have other ideas?
Another thing connected to this issue is that the OpenAlex API now introduced a burst rate limit of 10 requests per second. This would also affect the session object since it might make multiple requests too fast, so they fail. So this should be considered and handled at this point as well when introducing a session to the library, so a bit of research is needed to look into available solutions/libraries.
Maybe you know of one?
When doing a lot of requests to the same endpoint, it is probably helpful for runtime (and also is "cheaper" on OA server side, I guess) not to create a new connection each time but re-use Session object.
Please correct me if I am wrong here.
I also have done minor changes to test that - it seems to work faster (and hopefully "cheaper" on server side), so i can do a small PR.
The text was updated successfully, but these errors were encountered: