PHP Класс Kraken\Channel\Channel

Наследование: extends Kraken\Event\EventEmitter, implements Kraken\Channel\ChannelInterface, use trait Kraken\Loop\LoopAwareTrait, use trait Kraken\Channel\Record\RequestRecordStorage, use trait Kraken\Channel\Record\ResponseRecordStorage
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$counter integer
$encoder Kraken\Channel\Encoder\EncoderInterface
$handlers Kraken\Event\EventListener[]
$model Kraken\Channel\ChannelModelInterface
$name string
$repsHelperTimer Kraken\Loop\Timer\TimerInterface
$reqsHelperTimer Kraken\Loop\Timer\TimerInterface
$router Kraken\Channel\Router\RouterCompositeInterface
$seed string

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

Метод Описание
__construct ( string $name, Kraken\Channel\ChannelModelInterface $model, Kraken\Channel\Router\RouterCompositeInterface $router, Kraken\Channel\Encoder\EncoderInterface $encoder, Kraken\Loop\LoopInterface $loop )
__destruct ( )
createProtocol ( $message = null )
filterConnected ( $pattern )
getConnected ( )
getInput ( )
getModel ( )
getName ( )
getOutput ( )
getRouter ( )
handleReceive ( $sender, $multipartMessage )
isConnected ( $name )
isStarted ( )
isStopped ( )
onConnect ( callable $handler )
onDisconnect ( callable $handler )
onInput ( callable $handler )
onOutput ( callable $handler )
onStart ( callable $handler )
onStop ( callable $handler )
pull ( $sender, Kraken\Channel\Protocol\ProtocolInterface $protocol )
push ( $name, $message, $flags = Channel::MODE_DEFAULT, callable $success = null, callable $failure = null, callable $cancel = null, $timeout )
pushAsync ( $name, $message, $flags = Channel::MODE_DEFAULT )
pushRequest ( $name, $message, $flags = Channel::MODE_DEFAULT, callable $success = null, callable $failure = null, callable $cancel = null, $timeout )
receive ( $sender, Kraken\Channel\Protocol\ProtocolInterface $protocol )
send ( $name, $message, $flags = Channel::MODE_DEFAULT, callable $success = null, callable $failure = null, callable $cancel = null, $timeout )
sendAsync ( $name, $message, $flags = Channel::MODE_DEFAULT )
sendRequest ( $name, $message, $flags = Channel::MODE_DEFAULT, callable $success = null, callable $failure = null, callable $cancel = null, $timeout )
start ( )
stop ( )

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

Метод Описание
createMessageProtocol ( string | string[] $message ) : Kraken\Channel\Protocol\ProtocolInterface
genID ( ) : string
getNextSuffix ( ) : string
getTime ( ) : float
handlePushAsync ( $name, $message, $flags = Channel::MODE_DEFAULT )
handlePushRequest ( $name, $message, $flags = Channel::MODE_DEFAULT, callable $success = null, callable $failure = null, callable $cancel = null, $timeout )
handleReceiveRequest ( Kraken\Channel\Protocol\ProtocolInterface $protocol ) : boolean
handleReceiveResponse ( Kraken\Channel\Protocol\ProtocolInterface $protocol ) : boolean
handleSendAsync ( $name, $message, $flags = Channel::MODE_DEFAULT )
handleSendRequest ( $name, $message, $flags = Channel::MODE_DEFAULT, callable $success = null, callable $failure = null, callable $cancel = null, $timeout )

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

Метод Описание
registerEvents ( )
registerPeriodicTimers ( )
unregisterEvents ( )
unregisterPeriodicTimers ( )

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

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

public __construct ( string $name, Kraken\Channel\ChannelModelInterface $model, Kraken\Channel\Router\RouterCompositeInterface $router, Kraken\Channel\Encoder\EncoderInterface $encoder, Kraken\Loop\LoopInterface $loop )
$name string
$model Kraken\Channel\ChannelModelInterface
$router Kraken\Channel\Router\RouterCompositeInterface
$encoder Kraken\Channel\Encoder\EncoderInterface
$loop Kraken\Loop\LoopInterface

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

public __destruct ( )

createMessageProtocol() защищенный метод

protected createMessageProtocol ( string | string[] $message ) : Kraken\Channel\Protocol\ProtocolInterface
$message string | string[]
Результат Kraken\Channel\Protocol\ProtocolInterface

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

public createProtocol ( $message = null )

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

public filterConnected ( $pattern )

genID() защищенный метод

protected genID ( ) : string
Результат string

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

public getConnected ( )

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

public getInput ( )

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

public getModel ( )

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

public getName ( )

getNextSuffix() защищенный метод

protected getNextSuffix ( ) : string
Результат string

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

public getOutput ( )

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

public getRouter ( )

getTime() защищенный метод

protected getTime ( ) : float
Результат float

handlePushAsync() защищенный метод

protected handlePushAsync ( $name, $message, $flags = Channel::MODE_DEFAULT )

handlePushRequest() защищенный метод

protected handlePushRequest ( $name, $message, $flags = Channel::MODE_DEFAULT, callable $success = null, callable $failure = null, callable $cancel = null, $timeout )
$success callable
$failure callable
$cancel callable

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

public handleReceive ( $sender, $multipartMessage )

handleReceiveRequest() защищенный метод

protected handleReceiveRequest ( Kraken\Channel\Protocol\ProtocolInterface $protocol ) : boolean
$protocol Kraken\Channel\Protocol\ProtocolInterface
Результат boolean

handleReceiveResponse() защищенный метод

protected handleReceiveResponse ( Kraken\Channel\Protocol\ProtocolInterface $protocol ) : boolean
$protocol Kraken\Channel\Protocol\ProtocolInterface
Результат boolean

handleSendAsync() защищенный метод

protected handleSendAsync ( $name, $message, $flags = Channel::MODE_DEFAULT )

handleSendRequest() защищенный метод

protected handleSendRequest ( $name, $message, $flags = Channel::MODE_DEFAULT, callable $success = null, callable $failure = null, callable $cancel = null, $timeout )
$success callable
$failure callable
$cancel callable

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

public isConnected ( $name )

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

public isStarted ( )

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

public isStopped ( )

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

public onConnect ( callable $handler )
$handler callable

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

public onDisconnect ( callable $handler )
$handler callable

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

public onInput ( callable $handler )
$handler callable

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

public onOutput ( callable $handler )
$handler callable

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

public onStart ( callable $handler )
$handler callable

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

public onStop ( callable $handler )
$handler callable

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

public pull ( $sender, Kraken\Channel\Protocol\ProtocolInterface $protocol )
$protocol Kraken\Channel\Protocol\ProtocolInterface

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

public push ( $name, $message, $flags = Channel::MODE_DEFAULT, callable $success = null, callable $failure = null, callable $cancel = null, $timeout )
$success callable
$failure callable
$cancel callable

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

public pushAsync ( $name, $message, $flags = Channel::MODE_DEFAULT )

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

public pushRequest ( $name, $message, $flags = Channel::MODE_DEFAULT, callable $success = null, callable $failure = null, callable $cancel = null, $timeout )
$success callable
$failure callable
$cancel callable

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

public receive ( $sender, Kraken\Channel\Protocol\ProtocolInterface $protocol )
$protocol Kraken\Channel\Protocol\ProtocolInterface

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

public send ( $name, $message, $flags = Channel::MODE_DEFAULT, callable $success = null, callable $failure = null, callable $cancel = null, $timeout )
$success callable
$failure callable
$cancel callable

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

public sendAsync ( $name, $message, $flags = Channel::MODE_DEFAULT )

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

public sendRequest ( $name, $message, $flags = Channel::MODE_DEFAULT, callable $success = null, callable $failure = null, callable $cancel = null, $timeout )
$success callable
$failure callable
$cancel callable

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

public start ( )

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

public stop ( )

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

$counter защищенное свойство

protected int $counter
Результат integer

$encoder защищенное свойство

protected EncoderInterface,Kraken\Channel\Encoder $encoder
Результат Kraken\Channel\Encoder\EncoderInterface

$handlers защищенное свойство

protected EventListener[],Kraken\Event $handlers
Результат Kraken\Event\EventListener[]

$model защищенное свойство

protected ChannelModelInterface,Kraken\Channel $model
Результат Kraken\Channel\ChannelModelInterface

$name защищенное свойство

protected string $name
Результат string

$repsHelperTimer защищенное свойство

protected TimerInterface,Kraken\Loop\Timer $repsHelperTimer
Результат Kraken\Loop\Timer\TimerInterface

$reqsHelperTimer защищенное свойство

protected TimerInterface,Kraken\Loop\Timer $reqsHelperTimer
Результат Kraken\Loop\Timer\TimerInterface

$router защищенное свойство

protected RouterCompositeInterface,Kraken\Channel\Router $router
Результат Kraken\Channel\Router\RouterCompositeInterface

$seed защищенное свойство

protected string $seed
Результат string