PHP Class Kraken\Channel\Model\Zmq\ZmqModel

Inheritance: extends Kraken\Event\BaseEventEmitter, implements Kraken\Channel\ChannelModelInterface
Show file Open project: kraken-php/framework

Public Properties

Property Type Description
$socket Kraken\Ipc\Zmq\ZmqSocket

Protected Properties

Property Type Description
$buffer Kraken\Channel\Model\Zmq\Buffer\Buffer
$connectCallback callable
$connectionPool Kraken\Channel\Model\Zmq\Connection\ConnectionPool
$context Kraken\Ipc\Zmq\ZmqContext
$disconnectCallback callable
$endpoint string
$flags string[]
$hosts string[]
$id string
$isConnected boolean
$loop Kraken\Loop\LoopInterface
$options mixed[]
$pendingOperation string
$type integer

Public Methods

Method Description
__construct ( Kraken\Loop\LoopInterface $loop, string[] $params )
__destruct ( )
broadcast ( $message )
getConnected ( )
isConnected ( $id )
isStarted ( )
isStopped ( )
markConnectionOnline ( string $id, float $until ) Set connection statically to be marked as online until specific timestamp.
markConnectionPersistent ( string $id ) Set connection statically to be marked always as online.
onMessages ( string[] $argv )
start ( $blockEvent = false )
stop ( $blockEvent = false )
unicast ( $id, $message, $flags = self::MODE_STANDARD )

Protected Methods

Method Description
getBuffer ( ) : Buffer
getConnectionPool ( ) : ConnectionPool
getSocket ( ) : ZmqSocket
getSocketType ( ) : integer
parseBinderMessage ( string[] $multipartMessage ) : string[]
parseConnectorMessage ( string[] $multipartMessage ) : string[]
prepareBinderMessage ( string $id, string $type ) : string[]
prepareConnectorMessage ( string $id, string $type ) : string[]
removeEventListener ( string $event, callable $callback )
setEventListener ( string $event, callable $callback )

Private Methods

Method Description
clearConnectionPool ( )
fail ( )
getFrame ( string $id, string $type, mixed $message ) : null | string[]
getSocketConnectorType ( integer $type ) : integer
getSocketDisconnectorType ( integer $type ) : integer
heartbeat ( string $id ) : boolean
onRecvHeartbeat ( Connection $conn )
onRecvMessage ( Connection $conn, string[] $message )
recvHeartbeat ( Connection $conn )
recvMessage ( Connection $conn, $message ) : mixed
sendMessage ( string $id, string $type, mixed $message = null, integer $flags = self::MODE_STANDARD ) : boolean
startHeartbeat ( )
startTimeRegister ( ) Start time register.
stopHeartbeat ( )
stopTimeRegister ( ) Stop time register.

Method Details

__construct() public method

public __construct ( Kraken\Loop\LoopInterface $loop, string[] $params )
$loop Kraken\Loop\LoopInterface
$params string[]

__destruct() public method

public __destruct ( )

broadcast() public method

public broadcast ( $message )

getBuffer() protected method

protected getBuffer ( ) : Buffer
return Kraken\Channel\Model\Zmq\Buffer\Buffer

getConnected() public method

public getConnected ( )

getConnectionPool() protected method

protected getConnectionPool ( ) : ConnectionPool
return Kraken\Channel\Model\Zmq\Connection\ConnectionPool

getSocket() protected method

protected getSocket ( ) : ZmqSocket
return Kraken\Ipc\Zmq\ZmqSocket

getSocketType() abstract protected method

abstract protected getSocketType ( ) : integer
return integer

isConnected() public method

public isConnected ( $id )

isStarted() public method

public isStarted ( )

isStopped() public method

public isStopped ( )

markConnectionOnline() public method

Set connection statically to be marked as online until specific timestamp.
public markConnectionOnline ( string $id, float $until )
$id string
$until float

markConnectionPersistent() public method

Set connection statically to be marked always as online.

onMessages() public method

public onMessages ( string[] $argv )
$argv string[]

parseBinderMessage() abstract protected method

abstract protected parseBinderMessage ( string[] $multipartMessage ) : string[]
$multipartMessage string[]
return string[]

parseConnectorMessage() abstract protected method

abstract protected parseConnectorMessage ( string[] $multipartMessage ) : string[]
$multipartMessage string[]
return string[]

prepareBinderMessage() abstract protected method

abstract protected prepareBinderMessage ( string $id, string $type ) : string[]
$id string
$type string
return string[]

prepareConnectorMessage() abstract protected method

abstract protected prepareConnectorMessage ( string $id, string $type ) : string[]
$id string
$type string
return string[]

removeEventListener() protected method

protected removeEventListener ( string $event, callable $callback )
$event string
$callback callable

setEventListener() protected method

protected setEventListener ( string $event, callable $callback )
$event string
$callback callable

start() public method

public start ( $blockEvent = false )

stop() public method

public stop ( $blockEvent = false )

unicast() public method

public unicast ( $id, $message, $flags = self::MODE_STANDARD )

Property Details

$buffer protected property

protected Buffer,Kraken\Channel\Model\Zmq\Buffer $buffer
return Kraken\Channel\Model\Zmq\Buffer\Buffer

$connectCallback protected property

protected callable $connectCallback
return callable

$connectionPool protected property

protected ConnectionPool,Kraken\Channel\Model\Zmq\Connection $connectionPool
return Kraken\Channel\Model\Zmq\Connection\ConnectionPool

$context protected property

protected ZmqContext,Kraken\Ipc\Zmq $context
return Kraken\Ipc\Zmq\ZmqContext

$disconnectCallback protected property

protected callable $disconnectCallback
return callable

$endpoint protected property

protected string $endpoint
return string

$flags protected property

protected string[] $flags
return string[]

$hosts protected property

protected string[] $hosts
return string[]

$id protected property

protected string $id
return string

$isConnected protected property

protected bool $isConnected
return boolean

$loop protected property

protected LoopInterface,Kraken\Loop $loop
return Kraken\Loop\LoopInterface

$options protected property

protected mixed[] $options
return mixed[]

$pendingOperation protected property

protected string $pendingOperation
return string

$socket public property

public ZmqSocket,Kraken\Ipc\Zmq $socket
return Kraken\Ipc\Zmq\ZmqSocket

$type protected property

protected int $type
return integer