PHP Interface Kraken\Channel\ChannelModelInterface

Inheritance: extends Kraken\Event\EventEmitterInterface
Show file Open project: kraken-php/framework Interface Usage Examples

Public Methods

Method Description
broadcast ( string[] | string $message ) : bool[] Send broadcast message.
getConnected ( ) : string[] Return array of all connected external channels' IDs.
isConnected ( string $id ) : boolean Check if specific external channel is connected.
isStarted ( ) : boolean Check if channel is started.
isStopped ( ) : boolean Check if channel is stopped.
start ( boolean $blockEvent = false ) : boolean Start Channel.
stop ( boolean $blockEvent = false ) : boolean Stop Channel.
unicast ( string $alias, string[] | string $message, integer $flags ) : boolean Send unicast message.

Method Details

broadcast() public method

Send broadcast message.
public broadcast ( string[] | string $message ) : bool[]
$message string[] | string
return bool[]

getConnected() public method

Return array of all connected external channels' IDs.
public getConnected ( ) : string[]
return string[]

isConnected() public method

Check if specific external channel is connected.
public isConnected ( string $id ) : boolean
$id string
return boolean

isStarted() public method

Check if channel is started.
public isStarted ( ) : boolean
return boolean

isStopped() public method

Check if channel is stopped.
public isStopped ( ) : boolean
return boolean

start() public method

Start Channel.
public start ( boolean $blockEvent = false ) : boolean
$blockEvent boolean
return boolean

stop() public method

Stop Channel.
public stop ( boolean $blockEvent = false ) : boolean
$blockEvent boolean
return boolean

unicast() public method

Flags might be one of: Channel::MODE_STANDARD - sends message if both sender and receiver are online. Channel::MODE_BUFFER_OFFLINE - works in similar way as MODE_STANDARD, but also enables buffering messages in case that sender is offline. Channel::MODE_BUFFER_ONLINE - works in similar way as MODE_STANDARD, but also enables buffering messages in case that receiver is offline. Channel::MODE_BUFFER - sends message if both sender and receiver are online or buffers it if one of them is offline.
public unicast ( string $alias, string[] | string $message, integer $flags ) : boolean
$alias string
$message string[] | string
$flags integer
return boolean