PHP Class Thruway\Subscription\StateHandlerRegistry

Inheritance: extends Thruway\Module\RouterModuleClient
显示文件 Open project: voryx/thruway

Public Methods

Method Description
__construct ( string $realm, React\EventLoop\LoopInterface $loop = null )
addStateHandler ( $args )
getReady ( ) : boolean Get ready flag
initModule ( Thruway\Peer\RouterInterface $router, React\EventLoop\LoopInterface $loop ) Gets called when the module is initialized in the router
onSessionStart ( ClientSession $session, Thruway\Transport\TransportProviderInterface $transport ) Handles session started
processSubscriptionAdded ( Subscription $subscription )
processSubscriptionRemoved ( Subscription $subscription )
removeStateHandler ( $args )
setReady ( boolean $ready ) Set ready flag

Private Methods

Method Description
getStateHandlerRegistrationForSubscription ( Subscription $subscription ) : StateHandlerRegistration | boolean | null
mapNewStateHandlerRegistration ( StateHandlerRegistration $stateHandlerRegistration )
setupStateHandlerRegistration ( SubscriptionGroup $subscriptionGroup ) Called when we need to setup a registration If there is a registration that works - then we set the handler Otherwise, we set it to null

Method Details

__construct() public method

public __construct ( string $realm, React\EventLoop\LoopInterface $loop = null )
$realm string
$loop React\EventLoop\LoopInterface

addStateHandler() public method

public addStateHandler ( $args )
$args

getReady() public method

Get ready flag
public getReady ( ) : boolean
return boolean

initModule() public method

Gets called when the module is initialized in the router
public initModule ( Thruway\Peer\RouterInterface $router, React\EventLoop\LoopInterface $loop )
$router Thruway\Peer\RouterInterface
$loop React\EventLoop\LoopInterface

onSessionStart() public method

Handles session started
public onSessionStart ( ClientSession $session, Thruway\Transport\TransportProviderInterface $transport )
$session Thruway\ClientSession
$transport Thruway\Transport\TransportProviderInterface

processSubscriptionAdded() public method

public processSubscriptionAdded ( Subscription $subscription )
$subscription Subscription

processSubscriptionRemoved() public method

public processSubscriptionRemoved ( Subscription $subscription )
$subscription Subscription

removeStateHandler() public method

public removeStateHandler ( $args )
$args

setReady() public method

Set ready flag
public setReady ( boolean $ready )
$ready boolean