PHP Класс Aerys\Server

Наследование: implements SplSubject, use trait Struct
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
__construct ( Options $options, VhostContainer $vhosts, Psr\Log\LoggerInterface $logger, Ticker $ticker )
__debugInfo ( )
attach ( aerys\ServerObserver $observer ) : void Attach an observer
detach ( aerys\ServerObserver $observer ) : void Detach an Observer
getOption ( string $option ) Retrieve a server option value
monitor ( ) : array
setOption ( string $option, mixed $newValue ) : void Assign a server option value
start ( ) : Promise Start the server
state ( ) : integer Retrieve the current server state
stop ( ) : Promise Stop the server

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

Метод Описание
bind ( string $address, $context )
clear ( Client $client )
clearKeepAliveTimeout ( Client $client )
close ( Client $client )
doStart ( ) : Generator
doStop ( ) : Generator
dropPrivileges ( )
export ( Client $client ) : Closure
failCryptoNegotiation ( $socket, $ip )
generateBindableAddressContextMap ( )
importClient ( $socket, $ip, $port )
initializeRequest ( Client $client, array $parseResult ) : InternalRequest
initializeResponse ( InternalRequest $ireq, array $filters ) : aerys\Response
logDebug ( $message ) This function MUST always return TRUE. It should only be invoked inside an assert() block so that we can cancel its opcodes when in production mode. This approach allows us to take full advantage of debug mode log output without adding superfluous method call overhead in production environments.
makePrivateCallable ( string $method ) : Closure We frequently have to pass callables to outside code (like amp).
negotiateCrypto ( string $watcherId, $socket, $peer )
notify ( ) : Promise Notify observers of a server state change
onAcceptable ( string $watcherId, $server )
onApplicationError ( Throwable $error, InternalRequest $ireq, aerys\Response $response, array $filters )
onCoroutineAppResolve ( $error, $result, $info )
onEntitySizeWarning ( Client $client, array $parseResult )
onParseEmit ( Client $client, $eventType, $parseResult, $errorStruct = null )
onParseError ( Client $client, array $parseResult, string $error )
onParsedEntityHeaders ( Client $client, array $parseResult )
onParsedEntityPart ( Client $client, array $parseResult )
onParsedMessageWithEntity ( Client $client, array $parseResult )
onParsedMessageWithoutEntity ( Client $client, array $parseResult )
onReadable ( string $watcherId, $socket, $client )
onResponseDataDone ( Client $client )
onWritable ( string $watcherId, $socket, $client )
renewKeepAliveTimeout ( Client $client )
respond ( InternalRequest $ireq )
sendPreAppInvalidHostResponse ( aerys\Request $request, aerys\Response $response )
sendPreAppMethodNotAllowedResponse ( aerys\Request $request, aerys\Response $response )
sendPreAppOptionsResponse ( aerys\Request $request, aerys\Response $response )
sendPreAppServiceUnavailableResponse ( aerys\Request $request, aerys\Response $response )
sendPreAppTraceResponse ( aerys\Request $request, aerys\Response $response )
setTrace ( InternalRequest $ireq )
timeoutKeepAlives ( integer $now )
tryApplication ( InternalRequest $ireq, callable $application, array $filters )
tryErrorResponse ( Throwable $error, InternalRequest $ireq, aerys\Response $response, array $filters )
tryFilterErrorResponse ( Throwable $error, InternalRequest $ireq, array $filters ) When an uncaught exception is thrown by a filter we enable the $ireq->filterErrorFlag and add the offending filter's key to $ireq->badFilterKeys. Each time we initialize a response the bad filters are removed from the chain in an effort to invoke all possible filters. To handle the scenario where multiple filters error we need to continue looping until $ireq->filterErrorFlag no longer reports as true.
writeResponse ( Client $client, $final = false )

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

__construct() публичный Метод

public __construct ( Options $options, VhostContainer $vhosts, Psr\Log\LoggerInterface $logger, Ticker $ticker )
$options Options
$vhosts VhostContainer
$logger Psr\Log\LoggerInterface
$ticker Ticker

__debugInfo() публичный Метод

public __debugInfo ( )

attach() публичный Метод

Attach an observer
public attach ( aerys\ServerObserver $observer ) : void
$observer aerys\ServerObserver
Результат void

detach() публичный Метод

Detach an Observer
public detach ( aerys\ServerObserver $observer ) : void
$observer aerys\ServerObserver
Результат void

getOption() публичный Метод

Retrieve a server option value
public getOption ( string $option )
$option string The option to retrieve

monitor() публичный Метод

public monitor ( ) : array
Результат array

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

Assign a server option value
public setOption ( string $option, mixed $newValue ) : void
$option string The option to retrieve
$newValue mixed
Результат void

start() публичный Метод

Start the server
public start ( ) : Promise
Результат Promise

state() публичный Метод

Retrieve the current server state
public state ( ) : integer
Результат integer

stop() публичный Метод

Stop the server
public stop ( ) : Promise
Результат Promise