this PR changed from session-per-request to session-over-time.
previous implementation session-per-request:
Every time we call API with get*, it will create a session within get_session() function.
Current implementation session-over-time:
System creates a global variable session, initially be assigned with None.
Once get_session() has been called for the first time, it will create the global session and setup retry strategy for it. (*)
Retry strategy can only be setup on session level. If we create session in global, the code will not respect the APIConfig retry strategy (ApiConfig could be designed to be a config object to pass into each request, instead of make functions depend on a global one)
con:
clients cannot change the retry strategy after the first request, (System can add a listener on ApiConfig, and every time clients change retry config, system generate a new session)
this PR changed from session-per-request to session-over-time.
previous implementation session-per-request: Every time we call API with get*, it will create a session within get_session() function.
Current implementation session-over-time:
APIConfig
retry strategy (ApiConfig could be designed to be a config object to pass into each request, instead of make functions depend on a global one)con: