aboutsummaryrefslogtreecommitdiffhomepage
path: root/assets/php/vendor/react/socket/src/TimeoutConnector.php
diff options
context:
space:
mode:
Diffstat (limited to 'assets/php/vendor/react/socket/src/TimeoutConnector.php')
-rw-r--r--assets/php/vendor/react/socket/src/TimeoutConnector.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/assets/php/vendor/react/socket/src/TimeoutConnector.php b/assets/php/vendor/react/socket/src/TimeoutConnector.php
new file mode 100644
index 0000000..d4eba2e
--- /dev/null
+++ b/assets/php/vendor/react/socket/src/TimeoutConnector.php
@@ -0,0 +1,25 @@
+<?php
+
+namespace React\Socket;
+
+use React\EventLoop\LoopInterface;
+use React\Promise\Timer;
+
+final class TimeoutConnector implements ConnectorInterface
+{
+ private $connector;
+ private $timeout;
+ private $loop;
+
+ public function __construct(ConnectorInterface $connector, $timeout, LoopInterface $loop)
+ {
+ $this->connector = $connector;
+ $this->timeout = $timeout;
+ $this->loop = $loop;
+ }
+
+ public function connect($uri)
+ {
+ return Timer\timeout($this->connector->connect($uri), $this->timeout, $this->loop);
+ }
+}