PHP Класс Amp\Artax\SocketPool

Показать файл Открыть проект

Открытые методы

Метод Описание
checkin ( resource $resource ) : self Return a previously checked-out socket to the pool
checkout ( string $uri, array $options = [] ) : Amp\Promise Checkout a socket from the specified URI authority
clear ( resource $resource ) : self Remove the specified socket from the pool
setOption ( integer $option, mixed $value ) : self Set socket pool options

Приватные методы

Метод Описание
allowsNewConnection ( $uri, $options )
checkoutExistingSocket ( $uri, $options )
checkoutNewSocket ( $uri, $options )
dequeueNextWaitingSocket ( $uri )
finalizeNewConnection ( Amp\Deferred $promisor, $uri, $socket, $options )
finalizeSocketCheckin ( $uri, $socketId )
initializeIdleTimeout ( Amp\Artax\SocketPoolStruct $poolStruct )
initializeNewConnection ( Amp\Deferred $promisor, $uri, $options )
isSocketDead ( $resource )
unloadSocket ( $uri, $socketId )

Описание методов

checkin() публичный метод

Return a previously checked-out socket to the pool
public checkin ( resource $resource ) : self
$resource resource
Результат self

checkout() публичный метод

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
Результат Amp\Promise Returns a promise that resolves to a socket once a connection is available

clear() публичный метод

Remove the specified socket from the pool
public clear ( resource $resource ) : self
$resource resource
Результат self

setOption() публичный метод

Set socket pool options
public setOption ( integer $option, mixed $value ) : self
$option integer
$value mixed
Результат self