PHP 클래스 Amp\Artax\SocketPool

파일 보기 프로젝트 열기: amphp/artax

공개 메소드들

메소드 설명
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