PHP Interface Thruway\Peer\RouterInterface

Inheritance: extends Thruway\Peer\PeerInterface
Afficher le fichier Open project: voryx/thruway Interface Usage Examples

Méthodes publiques

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

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

createNewSession() public méthode

public createNewSession ( Thruway\Transport\TransportInterface $transport ) : Session
$transport Thruway\Transport\TransportInterface
Résultat Thruway\Session

getAuthenticationManager() public méthode

Get authentication manager
public getAuthenticationManager ( ) : Thruway\Authentication\AuthenticationManagerInterface
Résultat Thruway\Authentication\AuthenticationManagerInterface

getEventDispatcher() public méthode

public getEventDispatcher ( ) : EventDispatcher
Résultat Thruway\Event\EventDispatcher

getRealmManager() public méthode

Get realm manager
public getRealmManager ( ) : RealmManager
Résultat Thruway\RealmManager

getSessionBySessionId() public méthode

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

onClose() public méthode

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

onMessage() public méthode

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

setAuthenticationManager() public méthode

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

start() public méthode

Start the transport
public start ( )

stop() public méthode

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