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