PHP Класс PHPDaemon\Servers\WebSocket\Pool

Наследование: extends PHPDaemon\Network\Server, use trait PHPDaemon\Traits\EventHandlers
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$routes array

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

Метод Описание
addRoute ( string $path, callable $cb ) : boolean Adds a route if it doesn't exist already.
getRoute ( string $path, object $client, boolean $withoutCustomTransport = false ) : mixed
getRouteOptions ( string $path ) : array Return options by route
removeRoute ( string $path ) : boolean Removes a route.
routeExists ( string $path ) : boolean Checks if route exists
setRoute ( string $path, callable $cb ) : boolean Force add/replace a route.
setRouteOptions ( string $path, array $opts ) : boolean Sets an array of options associated to the route

Защищенные методы

Метод Описание
getConfigDefaults ( ) : array | boolean Setting default config options Overriden from ConnectionPool::getConfigDefaults

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

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

Adds a route if it doesn't exist already.
public addRoute ( string $path, callable $cb ) : boolean
$path string Route name.
$cb callable Route's callback.
Результат boolean Success.

getConfigDefaults() защищенный Метод

Setting default config options Overriden from ConnectionPool::getConfigDefaults
protected getConfigDefaults ( ) : array | boolean
Результат array | boolean

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

public getRoute ( string $path, object $client, boolean $withoutCustomTransport = false ) : mixed
$path string
$client object
$withoutCustomTransport boolean
Результат mixed

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

Return options by route
public getRouteOptions ( string $path ) : array
$path string Route name
Результат array Options

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

Removes a route.
public removeRoute ( string $path ) : boolean
$path string Route name
Результат boolean Success

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

Checks if route exists
public routeExists ( string $path ) : boolean
$path string Route name
Результат boolean Exists?

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

Force add/replace a route.
public setRoute ( string $path, callable $cb ) : boolean
$path string Path
$cb callable Callback
Результат boolean Success

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

Sets an array of options associated to the route
public setRouteOptions ( string $path, array $opts ) : boolean
$path string Route name.
$opts array Options
Результат boolean Success.

Описание свойств

$routes публичное свойство

public array $routes
Результат array