PHP Class Thruway\Subscription\SubscriptionGroup

This groups subscriptions that have exactly the same matching criteria.
Inheritance: use trait Thruway\Message\Traits\OptionsTrait, use trait Thruway\Message\Traits\OptionsMatchTypeTrait
Mostra file Open project: voryx/thruway Class Usage Examples

Protected Properties

Property Type Description
$lastPublicationId integer
$matcher Thruway\Subscription\MatcherInterface

Public Methods

Method Description
__construct ( Thruway\Subscription\MatcherInterface $matcher, $uri, $options )
addSubscription ( Subscription $subscription )
containsSubscriptionId ( $id ) : boolean
getLastPublicationId ( ) : integer
getMatchType ( ) : string
getMatcher ( ) : Thruway\Subscription\MatcherInterface
getStateHandler ( ) : string
getSubscriptions ( ) : array
getUri ( ) : mixed
hasStateHandler ( ) : boolean
leave ( Session $session )
processPublish ( Session $session, Thruway\Message\PublishMessage $msg )
processSubscribe ( Session $session, Thruway\Message\SubscribeMessage $msg ) : Subscription
processUnsubscribe ( Session $session, Thruway\Message\UnsubscribeMessage $msg ) : boolean | Subscription
removeStateHandler ( ) Remove the handler URI
removeSubscription ( Subscription $subscription )
setMatcher ( Thruway\Subscription\MatcherInterface $matcher )
setStateHandler ( string $handlerUri )
setSubscriptions ( array $subscriptions )
setUri ( mixed $uri )

Private Methods

Method Description
sendEventMessage ( Session $session, Thruway\Message\PublishMessage $msg, Subscription $subscription ) Send an Event Message for each subscription

Method Details

__construct() public method

public __construct ( Thruway\Subscription\MatcherInterface $matcher, $uri, $options )
$matcher Thruway\Subscription\MatcherInterface
$uri
$options

addSubscription() public method

public addSubscription ( Subscription $subscription )
$subscription Subscription

containsSubscriptionId() public method

public containsSubscriptionId ( $id ) : boolean
$id
return boolean

getLastPublicationId() public method

public getLastPublicationId ( ) : integer
return integer

getMatchType() public method

public getMatchType ( ) : string
return string

getMatcher() public method

public getMatcher ( ) : Thruway\Subscription\MatcherInterface
return Thruway\Subscription\MatcherInterface

getStateHandler() public method

public getStateHandler ( ) : string
return string

getSubscriptions() public method

public getSubscriptions ( ) : array
return array

getUri() public method

public getUri ( ) : mixed
return mixed

hasStateHandler() public method

public hasStateHandler ( ) : boolean
return boolean

leave() public method

public leave ( Session $session )
$session Thruway\Session

processPublish() public method

public processPublish ( Session $session, Thruway\Message\PublishMessage $msg )
$session Thruway\Session
$msg Thruway\Message\PublishMessage

processSubscribe() public method

public processSubscribe ( Session $session, Thruway\Message\SubscribeMessage $msg ) : Subscription
$session Thruway\Session
$msg Thruway\Message\SubscribeMessage
return Subscription

processUnsubscribe() public method

public processUnsubscribe ( Session $session, Thruway\Message\UnsubscribeMessage $msg ) : boolean | Subscription
$session Thruway\Session
$msg Thruway\Message\UnsubscribeMessage
return boolean | Subscription

removeStateHandler() public method

Remove the handler URI
public removeStateHandler ( )

removeSubscription() public method

public removeSubscription ( Subscription $subscription )
$subscription Subscription

setMatcher() public method

public setMatcher ( Thruway\Subscription\MatcherInterface $matcher )
$matcher Thruway\Subscription\MatcherInterface

setStateHandler() public method

public setStateHandler ( string $handlerUri )
$handlerUri string

setSubscriptions() public method

public setSubscriptions ( array $subscriptions )
$subscriptions array

setUri() public method

public setUri ( mixed $uri )
$uri mixed

Property Details

$lastPublicationId protected_oe property

protected int $lastPublicationId
return integer

$matcher protected_oe property

protected MatcherInterface,Thruway\Subscription $matcher
return Thruway\Subscription\MatcherInterface