PHP Class Kraken\Channel\ChannelComposite

Inheritance: extends Kraken\Event\BaseEventEmitter, implements Kraken\Channel\ChannelCompositeInterface, use trait Kraken\Loop\LoopAwareTrait
Afficher le fichier Open project: kraken-php/framework Class Usage Examples

Protected Properties

Свойство Type Description
$buses Kraken\Channel\ChannelInterface[] | Kraken\Channel\ChannelCompositeInterface[]
$counter integer
$events Kraken\Event\EventListener[][]
$name string
$router Kraken\Channel\Router\RouterCompositeInterface
$seed string

Méthodes publiques

Méthode Description
__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 ( )

Méthodes protégées

Méthode Description
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[]

Private Methods

Méthode Description
combine ( mixed | mixed[] | null $in, mixed | mixed[] | null $out, callable $combinator ) : mixed | mixed[]

Method Details

__construct() public méthode

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 méthode

public __destruct ( )

createMessageProtocol() protected méthode

protected createMessageProtocol ( Kraken\Channel\Protocol\ProtocolInterface | null | string | string[] $message ) : Kraken\Channel\Protocol\ProtocolInterface
$message Kraken\Channel\Protocol\ProtocolInterface | null | string | string[]
Résultat Kraken\Channel\Protocol\ProtocolInterface

createProtocol() public méthode

public createProtocol ( $message = null )

existsBus() public méthode

public existsBus ( $name )

filterConnected() public méthode

public filterConnected ( $pattern )

genID() protected méthode

protected genID ( ) : string
Résultat string

getBus() public méthode

public getBus ( $name )

getBuses() public méthode

public getBuses ( )

getConnected() public méthode

public getConnected ( )

getInput() public méthode

public getInput ( )

getModel() public méthode

public getModel ( )

getName() public méthode

public getName ( )

getNextSuffix() protected méthode

protected getNextSuffix ( ) : integer
Résultat integer

getOutput() public méthode

public getOutput ( )

getRouter() public méthode

public getRouter ( )

getTime() protected méthode

protected getTime ( ) : float
Résultat float

handlePushAsync() protected méthode

protected handlePushAsync ( string $name, Kraken\Channel\Protocol\ProtocolInterface $message, integer $flags = Channel::MODE_DEFAULT ) : boolean
$name string
$message Kraken\Channel\Protocol\ProtocolInterface
$flags integer
Résultat boolean

handlePushRequest() protected méthode

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
Résultat boolean

handleReceive() public méthode

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

handleSendAsync() protected méthode

protected handleSendAsync ( string $name, Kraken\Channel\Protocol\ProtocolInterface $message, integer $flags = Channel::MODE_DEFAULT ) : boolean
$name string
$message Kraken\Channel\Protocol\ProtocolInterface
$flags integer
Résultat boolean

handleSendRequest() protected méthode

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
Résultat bool[]

isConnected() public méthode

public isConnected ( $name )

isStarted() public méthode

public isStarted ( )

isStopped() public méthode

public isStopped ( )

onConnect() public méthode

public onConnect ( callable $handler )
$handler callable

onDisconnect() public méthode

public onDisconnect ( callable $handler )
$handler callable

onInput() public méthode

public onInput ( callable $handler )
$handler callable

onOutput() public méthode

public onOutput ( callable $handler )
$handler callable

onStart() public méthode

public onStart ( callable $handler )
$handler callable

onStop() public méthode

public onStop ( callable $handler )
$handler callable

pull() public méthode

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

push() public méthode

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 méthode

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

pushRequest() public méthode

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 méthode

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

removeBus() public méthode

public removeBus ( $name )

send() public méthode

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 méthode

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

sendRequest() public méthode

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 méthode

public setBus ( $name, $channel )

start() public méthode

public start ( )

stop() public méthode

public stop ( )

Property Details

$buses protected_oe property

protected ChannelInterface[],Kraken\Channel|ChannelCompositeInterface[],Kraken\Channel $buses
Résultat Kraken\Channel\ChannelInterface[] | Kraken\Channel\ChannelCompositeInterface[]

$counter protected_oe property

protected int $counter
Résultat integer

$events protected_oe property

protected EventListener[][],Kraken\Event $events
Résultat Kraken\Event\EventListener[][]

$name protected_oe property

protected string $name
Résultat string

$router protected_oe property

protected RouterCompositeInterface,Kraken\Channel\Router $router
Résultat Kraken\Channel\Router\RouterCompositeInterface

$seed protected_oe property

protected string $seed
Résultat string