PHP 클래스 Bravo3\Orm\Services\PubSubManager

파일 보기 프로젝트 열기: bravo3/orm

보호된 프로퍼티들

프로퍼티 타입 설명
$driver Bravo3\Orm\Drivers\PubSubDriverInterface
$event_dispatcher Symfony\Component\EventDispatcher\EventDispatcher

공개 메소드들

메소드 설명
__construct ( Bravo3\Orm\Drivers\PubSubDriverInterface $driver )
addListener ( string $channel, callable $callback, integer $priority ) : PubSubManager Add a callback to a channel which will get triggered when channel receives a message via a publisher.
eventTrigger ( array $payload ) : PubSubEvent Function triggers PubSub events based on the messages received on subscribed channels.
publish ( string $channel, string $message ) : boolean Publishes a message to the configured channel. Channel and Message length is limited based on the driver used.
removeListener ( string $channel, callable $callback ) : PubSubManager Removes the callbacks assigned to database driver PubSub mechanism.
run ( ) : void

비공개 메소드들

메소드 설명
generateEventName ( $channel ) : string Returns the event name with the prefix prepended.

메소드 상세

__construct() 공개 메소드

public __construct ( Bravo3\Orm\Drivers\PubSubDriverInterface $driver )
$driver Bravo3\Orm\Drivers\PubSubDriverInterface

addListener() 공개 메소드

Add a callback to a channel which will get triggered when channel receives a message via a publisher.
public addListener ( string $channel, callable $callback, integer $priority ) : PubSubManager
$channel string
$callback callable
$priority integer Default: 0
리턴 PubSubManager

eventTrigger() 공개 메소드

Function triggers PubSub events based on the messages received on subscribed channels.
public eventTrigger ( array $payload ) : PubSubEvent
$payload array
리턴 Bravo3\Orm\Events\PubSubEvent

publish() 공개 메소드

Returns true on success of delivery of the message, or false on failure. Usually a message delivery fails if there are not subscribed clients for the channel.
public publish ( string $channel, string $message ) : boolean
$channel string
$message string
리턴 boolean

removeListener() 공개 메소드

Removes the callbacks assigned to database driver PubSub mechanism.
public removeListener ( string $channel, callable $callback ) : PubSubManager
$channel string
$callback callable
리턴 PubSubManager

run() 공개 메소드

public run ( ) : void
리턴 void

프로퍼티 상세

$driver 보호되어 있는 프로퍼티

protected PubSubDriverInterface,Bravo3\Orm\Drivers $driver
리턴 Bravo3\Orm\Drivers\PubSubDriverInterface

$event_dispatcher 보호되어 있는 프로퍼티

protected EventDispatcher,Symfony\Component\EventDispatcher $event_dispatcher
리턴 Symfony\Component\EventDispatcher\EventDispatcher