Sillycore icon indicating copy to clipboard operation
Sillycore copied to clipboard

SillycoryRestClient thread safety

Open kutluarasli opened this issue 6 years ago • 3 comments

According to RestSharp (which is underlying dependecy of SillycoreRestClient) discussions, RestSharp.RestClient has thread safety issues.

This also hurt SillycoreRestClient thread safety and creating a new client for each request drives a new access token to be retrieved everytime.

Possible Solutions:

  1. Access token lifecycle and RestSharp.RestClient lifecycle may be decoupled which is handled in OAuth2Decorator. SillycoreRestClient can inject CachingTokenClient and Oath2Decorator is initiated for each call under the hood (or can be initiated for each call).

  2. Giving up RestSharp (which will break the interface). I just said :)

I expect to hear you comments :)

kutluarasli avatar Aug 02 '18 08:08 kutluarasli