Merge pull request #50 from refear99/timeout_params

add HttpRequestManager timeout params
This commit is contained in:
Kuan-Cheng,Lai 2018-02-25 13:13:21 +08:00 committed by GitHub
commit d02fb14bd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,11 +32,12 @@ class HttpRequestManager extends RequestManager implements IRequestManager
* construct * construct
* *
* @param string $host * @param string $host
* @param int $timeout
* @return void * @return void
*/ */
public function __construct($host) public function __construct($host, $timeout = 1)
{ {
parent::__construct($host); parent::__construct($host, $timeout);
$this->client = new Client; $this->client = new Client;
} }
@ -119,4 +120,4 @@ class HttpRequestManager extends RequestManager implements IRequestManager
call_user_func($callback, $err, null); call_user_func($callback, $err, null);
} }
} }
} }