Amp\Artax\SocketPool::checkout PHP Method

checkout() public method

The resulting socket resource should be checked back in via SocketPool::checkin() once the calling code is finished with the stream (even if the socket has been closed). Failure to checkin sockets will result in memory leaks and socket queue blockage.
public checkout ( string $uri, array $options = [] ) : Amp\Promise
$uri string A string of the form somedomain.com:80 or 192.168.1.1:443
$options array
return Amp\Promise Returns a promise that resolves to a socket once a connection is available
    public function checkout($uri, array $options = [])
    {
        $uri = stripos($uri, 'unix://') === 0 ? $uri : strtolower($uri);
        $options = $options ? array_merge($this->options, $options) : $this->options;
        return ($socket = $this->checkoutExistingSocket($uri, $options)) ? new Success($socket) : $this->checkoutNewSocket($uri, $options);
    }