PHP Class Kraken\Channel\Channel

Inheritance: 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
Afficher le fichier Open project: kraken-php/framework Class Usage Examples

Protected Properties

Свойство Type Description
$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

Méthodes publiques

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

Méthodes protégées

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

Private Methods

Méthode Description
registerEvents ( )
registerPeriodicTimers ( )
unregisterEvents ( )
unregisterPeriodicTimers ( )

Method Details

__construct() public méthode

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

public __destruct ( )

createMessageProtocol() protected méthode

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

createProtocol() public méthode

public createProtocol ( $message = null )

filterConnected() public méthode

public filterConnected ( $pattern )

genID() protected méthode

protected genID ( ) : string
Résultat string

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 ( ) : string
Résultat string

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 ( $name, $message, $flags = Channel::MODE_DEFAULT )

handlePushRequest() protected méthode

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

public handleReceive ( $sender, $multipartMessage )

handleReceiveRequest() protected méthode

protected handleReceiveRequest ( Kraken\Channel\Protocol\ProtocolInterface $protocol ) : boolean
$protocol Kraken\Channel\Protocol\ProtocolInterface
Résultat boolean

handleReceiveResponse() protected méthode

protected handleReceiveResponse ( Kraken\Channel\Protocol\ProtocolInterface $protocol ) : boolean
$protocol Kraken\Channel\Protocol\ProtocolInterface
Résultat boolean

handleSendAsync() protected méthode

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

handleSendRequest() protected méthode

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 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

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

start() public méthode

public start ( )

stop() public méthode

public stop ( )

Property Details

$counter protected_oe property

protected int $counter
Résultat integer

$encoder protected_oe property

protected EncoderInterface,Kraken\Channel\Encoder $encoder
Résultat Kraken\Channel\Encoder\EncoderInterface

$handlers protected_oe property

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

$model protected_oe property

protected ChannelModelInterface,Kraken\Channel $model
Résultat Kraken\Channel\ChannelModelInterface

$name protected_oe property

protected string $name
Résultat string

$repsHelperTimer protected_oe property

protected TimerInterface,Kraken\Loop\Timer $repsHelperTimer
Résultat Kraken\Loop\Timer\TimerInterface

$reqsHelperTimer protected_oe property

protected TimerInterface,Kraken\Loop\Timer $reqsHelperTimer
Résultat Kraken\Loop\Timer\TimerInterface

$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