PHP Interface Thruway\Peer\RouterInterface

Inheritance: extends Thruway\Peer\PeerInterface
Mostra file Open project: voryx/thruway Interface Usage Examples

Public Methods

Method Description
addInternalClient ( Thruway\Peer\ClientInterface $client ) Add a client that uses the internal transport provider
createNewSession ( Thruway\Transport\TransportInterface $transport ) : Session
getAuthenticationManager ( ) : Thruway\Authentication\AuthenticationManagerInterface Get authentication manager
getEventDispatcher ( ) : EventDispatcher
getRealmManager ( ) : RealmManager Get realm manager
getSessionBySessionId ( integer $sessionId ) : Session | boolean Get session by session ID
onClose ( Thruway\Transport\TransportInterface $transport ) Handle close session
onMessage ( Thruway\Transport\TransportInterface $transport, Thruway\Message\Message $msg ) : mixed Handle process message
setAuthenticationManager ( Thruway\Authentication\AuthenticationManagerInterface $authenticationManager ) Set authentication manager
start ( ) Start the transport
stop ( boolean $gracefully = true ) This is to stop the router.

Method Details

addInternalClient() public method

Add a client that uses the internal transport provider
public addInternalClient ( Thruway\Peer\ClientInterface $client )
$client Thruway\Peer\ClientInterface

createNewSession() public method

public createNewSession ( Thruway\Transport\TransportInterface $transport ) : Session
$transport Thruway\Transport\TransportInterface
return Thruway\Session

getAuthenticationManager() public method

Get authentication manager
public getAuthenticationManager ( ) : Thruway\Authentication\AuthenticationManagerInterface
return Thruway\Authentication\AuthenticationManagerInterface

getEventDispatcher() public method

public getEventDispatcher ( ) : EventDispatcher
return Thruway\Event\EventDispatcher

getRealmManager() public method

Get realm manager
public getRealmManager ( ) : RealmManager
return Thruway\RealmManager

getSessionBySessionId() public method

Get session by session ID
public getSessionBySessionId ( integer $sessionId ) : Session | boolean
$sessionId integer
return Thruway\Session | boolean

onClose() public method

Handle close session
public onClose ( Thruway\Transport\TransportInterface $transport )
$transport Thruway\Transport\TransportInterface

onMessage() public method

Handle process message
public onMessage ( Thruway\Transport\TransportInterface $transport, Thruway\Message\Message $msg ) : mixed
$transport Thruway\Transport\TransportInterface
$msg Thruway\Message\Message
return mixed

setAuthenticationManager() public method

Set authentication manager
public setAuthenticationManager ( Thruway\Authentication\AuthenticationManagerInterface $authenticationManager )
$authenticationManager Thruway\Authentication\AuthenticationManagerInterface

start() public method

Start the transport
public start ( )

stop() public method

Note that this should bring down all connections and timers associated with the router which will cause the loop to exit once there is nothing being watched. If there are other things added to the loop through clients or otherwise, the loop will continue running.
public stop ( boolean $gracefully = true )
$gracefully boolean