PHP Класс Kraken\Channel\ChannelComposite

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

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

Свойство Тип Описание
$buses Kraken\Channel\ChannelInterface[] | Kraken\Channel\ChannelCompositeInterface[]
$counter integer
$events Kraken\Event\EventListener[][]
$name string
$router Kraken\Channel\Router\RouterCompositeInterface
$seed string

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

Метод Описание
__construct ( string $name, Kraken\Channel\ChannelInterface[] | Kraken\Channel\ChannelCompositeInterface[] $buses = [], Kraken\Channel\Router\RouterCompositeInterface $router, Kraken\Loop\LoopInterface $loop )
__destruct ( )
createProtocol ( $message = null )
existsBus ( $name )
filterConnected ( $pattern )
getBus ( $name )
getBuses ( )
getConnected ( )
getInput ( )
getModel ( )
getName ( )
getOutput ( )
getRouter ( )
handleReceive ( string $sender, Kraken\Channel\Protocol\ProtocolInterface $protocol )
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 )
removeBus ( $name )
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 )
setBus ( $name, $channel )
start ( )
stop ( )

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

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

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

Метод Описание
combine ( mixed | mixed[] | null $in, mixed | mixed[] | null $out, callable $combinator ) : mixed | mixed[]

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

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

public __construct ( string $name, Kraken\Channel\ChannelInterface[] | Kraken\Channel\ChannelCompositeInterface[] $buses = [], Kraken\Channel\Router\RouterCompositeInterface $router, Kraken\Loop\LoopInterface $loop )
$name string
$buses Kraken\Channel\ChannelInterface[] | Kraken\Channel\ChannelCompositeInterface[]
$router Kraken\Channel\Router\RouterCompositeInterface
$loop Kraken\Loop\LoopInterface

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

public __destruct ( )

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

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

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

public createProtocol ( $message = null )

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

public existsBus ( $name )

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

public filterConnected ( $pattern )

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

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

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

public getBus ( $name )

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

public getBuses ( )

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

public getConnected ( )

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

public getInput ( )

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

public getModel ( )

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

public getName ( )

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

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

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

public getOutput ( )

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

public getRouter ( )

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

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

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

protected handlePushAsync ( string $name, Kraken\Channel\Protocol\ProtocolInterface $message, integer $flags = Channel::MODE_DEFAULT ) : boolean
$name string
$message Kraken\Channel\Protocol\ProtocolInterface
$flags integer
Результат boolean

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

protected handlePushRequest ( string $name, string | Kraken\Channel\Protocol\ProtocolInterface $message, integer $flags = Channel::MODE_DEFAULT, callable $success = null, callable $failure = null, callable $cancel = null, float $timeout ) : boolean
$name string
$message string | Kraken\Channel\Protocol\ProtocolInterface
$flags integer
$success callable
$failure callable
$cancel callable
$timeout float
Результат boolean

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

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

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

protected handleSendAsync ( string $name, Kraken\Channel\Protocol\ProtocolInterface $message, integer $flags = Channel::MODE_DEFAULT ) : boolean
$name string
$message Kraken\Channel\Protocol\ProtocolInterface
$flags integer
Результат boolean

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

protected handleSendRequest ( string $name, string | Kraken\Channel\Protocol\ProtocolInterface $message, integer $flags = Channel::MODE_DEFAULT, callable $success = null, callable $failure = null, callable $cancel = null, float $timeout ) : bool[]
$name string
$message string | Kraken\Channel\Protocol\ProtocolInterface
$flags integer
$success callable
$failure callable
$cancel callable
$timeout float
Результат bool[]

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

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

public removeBus ( $name )

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

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

public setBus ( $name, $channel )

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

public start ( )

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

public stop ( )

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

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

protected ChannelInterface[],Kraken\Channel|ChannelCompositeInterface[],Kraken\Channel $buses
Результат Kraken\Channel\ChannelInterface[] | Kraken\Channel\ChannelCompositeInterface[]

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

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

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

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

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

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

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

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

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

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