(self, endpoints: List[str], timeout: int = 120)
| 44 | |
| 45 | class Sam3ServicePool: |
| 46 | def __init__(self, endpoints: List[str], timeout: int = 120) -> None: |
| 47 | if len(endpoints) == 0: |
| 48 | raise ValueError("At least one endpoint is required") |
| 49 | self.clients = [Sam3ServiceClient(url, timeout=timeout) for url in endpoints] |
| 50 | self._lock = threading.Lock() |
| 51 | self._cursor = itertools.cycle(range(len(self.clients))) |
| 52 | |
| 53 | def predict(self, *args, **kwargs) -> Dict: |
| 54 | with self._lock: |
nothing calls this directly
no test coverage detected