HttpConfigurations.php
52 lines
| 1 | <?php |
| 2 | |
| 3 | namespace CoreInterfaces\Http; |
| 4 | |
| 5 | interface HttpConfigurations |
| 6 | { |
| 7 | /** |
| 8 | * Get timeout for API calls in seconds. |
| 9 | */ |
| 10 | public function getTimeout(): int; |
| 11 | |
| 12 | /** |
| 13 | * Get whether to enable retries and backoff feature. |
| 14 | */ |
| 15 | public function shouldEnableRetries(): bool; |
| 16 | |
| 17 | /** |
| 18 | * Get the number of retries to make. |
| 19 | */ |
| 20 | public function getNumberOfRetries(): int; |
| 21 | |
| 22 | /** |
| 23 | * Get the retry time interval between the endpoint calls. |
| 24 | */ |
| 25 | public function getRetryInterval(): float; |
| 26 | |
| 27 | /** |
| 28 | * Get exponential backoff factor to increase interval between retries. |
| 29 | */ |
| 30 | public function getBackOffFactor(): float; |
| 31 | |
| 32 | /** |
| 33 | * Get the maximum wait time in seconds for overall retrying requests. |
| 34 | */ |
| 35 | public function getMaximumRetryWaitTime(): int; |
| 36 | |
| 37 | /** |
| 38 | * Get whether to retry on request timeout. |
| 39 | */ |
| 40 | public function shouldRetryOnTimeout(): bool; |
| 41 | |
| 42 | /** |
| 43 | * Get http status codes to retry against. |
| 44 | */ |
| 45 | public function getHttpStatusCodesToRetry(): array; |
| 46 | |
| 47 | /** |
| 48 | * Get http methods to retry against. |
| 49 | */ |
| 50 | public function getHttpMethodsToRetry(): array; |
| 51 | } |
| 52 |