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