@@ -51,7 +51,13 @@ def get(self, metric_name: str) -> Optional[str]:
5151
5252class OrthancApiClient (HttpClient ):
5353
54- def __init__ (self , orthanc_root_url : str , user : Optional [str ] = None , pwd : Optional [str ] = None , api_token : Optional [str ] = None , headers : Optional [Dict [str , str ]] = None ) -> None :
54+ def __init__ (self ,
55+ orthanc_root_url : str ,
56+ user : Optional [str ] = None ,
57+ pwd : Optional [str ] = None ,
58+ api_token : Optional [str ] = None ,
59+ headers : Optional [Dict [str , str ]] = None ,
60+ pool_connections : int = 10 ) -> None :
5561 """Creates an HttpClient
5662
5763 Parameters
@@ -62,6 +68,8 @@ def __init__(self, orthanc_root_url: str, user: Optional[str] = None, pwd: Optio
6268 api_token: a token obtained from inside an Orthanc python plugin through orthanc.GenerateRestApiAuthorizationToken
6369 format: 'Bearer 3d03892c-fe...' or '3d03892c-fe...'
6470 headers: HTTP headers that will be included in each requests
71+ pool_connections: The number of HTTP connections in the pool (default=10). If you are using the client from more than 10 threads,
72+ you should increase this configuration.
6573 """
6674 if api_token :
6775 if headers is None :
@@ -72,7 +80,7 @@ def __init__(self, orthanc_root_url: str, user: Optional[str] = None, pwd: Optio
7280 header_value = f'Bearer { api_token } '
7381 headers ['authorization' ] = header_value
7482
75- super ().__init__ (root_url = orthanc_root_url , user = user , pwd = pwd , headers = headers )
83+ super ().__init__ (root_url = orthanc_root_url , user = user , pwd = pwd , headers = headers , pool_connections = pool_connections )
7684
7785 self .patients = Patients (api_client = self )
7886 self .studies = Studies (api_client = self )
0 commit comments