8000 minor #49791 [HttpClient] Add hint about `timeout` and `max_duration`… · melya/symfony@5eb54cf · GitHub
[go: up one dir, main page]

Skip to content

Commit 5eb54cf

Browse files
committed
minor symfony#49791 [HttpClient] Add hint about timeout and max_duration options (Kocal)
This PR was merged into the 5.4 branch. Discussion ---------- [HttpClient] Add hint about `timeout` and `max_duration` options | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | yes/no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead --> | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> When reading the PHPDoc or the documentation (https://symfony.com/doc/current/http_client.html#dealing-with-network-timeouts), we don't know if we must pass seconds or milliseconds. I believe `max_duration` is waiting for seconds, given the code from the `CurlHttpClient`: <img width="912" alt="image" src="https://user-images.githubusercontent.com/2103975/226627443-10dada66-4e55-4aff-9d33-de30c733b3f3.png"> Added hint for `timeout` option too. Commits ------- eb4b511 [HttpClient] Add hint about `timeout` and `max_duration` options
2 parents c42e033 + eb4b511 commit 5eb54cf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Contracts/HttpClient/HttpClientInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ interface HttpClientInterface
5454
'resolve' => [], // string[] - a map of host to IP address that SHOULD replace DNS resolution
5555
'proxy' => null, // string - by default, the proxy-related env vars handled by curl SHOULD be honored
5656
'no_proxy' => null, // string - a comma separated list of hosts that do not require a proxy to be reached
57-
'timeout' => null, // float - the idle timeout - defaults to ini_get('default_socket_timeout')
58-
'max_duration' => 0, // float - the maximum execution time for the request+response as a whole;
57+
'timeout' => null, // float - the idle timeout (in seconds) - defaults to ini_get('default_socket_timeout')
58+
'max_duration' => 0, // float - the maximum execution time (in seconds) for the request+response as a whole;
5959
// a value lower than or equal to 0 means it is unlimited
6060
'bindto' => '0', // string - the interface or the local socket to bind to
6161
'verify_peer' => true, // see https://php.net/context.ssl for the following options

0 commit comments

Comments
 (0)
0