diff --git a/src/future/postmark/PhutilPostmarkFuture.php b/src/future/postmark/PhutilPostmarkFuture.php --- a/src/future/postmark/PhutilPostmarkFuture.php +++ b/src/future/postmark/PhutilPostmarkFuture.php @@ -6,6 +6,7 @@ private $accessToken; private $method; private $parameters; + private $timeout; public function __construct() { parent::__construct(null); @@ -27,6 +28,15 @@ return $this; } + public function setTimeout($timeout) { + $this->timeout = $timeout; + return $this; + } + + public function getTimeout() { + return $this->timeout; + } + protected function getProxiedFuture() { if (!$this->future) { if ($this->accessToken === null) { @@ -49,6 +59,11 @@ ->addHeader('Accept', 'application/json') ->addHeader('Content-Type', 'application/json'); + $timeout = $this->getTimeout(); + if ($timeout) { + $future->setTimeout($timeout); + } + $this->future = $future; }