PHP Class Prooph\ServiceBus\MessageBus

Base class for a message bus implementation
Author: Alexander Miertsch ([email protected])
Show file Open project: prooph/service-bus Class Usage Examples

Protected Properties

Property Type Description
$events Prooph\Common\Event\ActionEventEmitter

Public Methods

Method Description
deactivate ( Prooph\Common\Event\ActionEventListenerAggregate $plugin )
dispatch ( mixed $message ) : mixed | void
getActionEventEmitter ( ) : Prooph\Common\Event\ActionEventEmitter Retrieve the action event dispatcher
setActionEventEmitter ( Prooph\Common\Event\ActionEventEmitter $actionEventDispatcher ) : void Inject an ActionEventDispatcher instance
utilize ( Prooph\Common\Event\ActionEventListenerAggregate $plugin )

Protected Methods

Method Description
getMessageName ( mixed $message ) : string
handleException ( Prooph\Common\Event\ActionEvent $actionEvent, Exception $ex )
initialize ( mixed $message, Prooph\Common\Event\ActionEvent $actionEvent )
trigger ( Prooph\Common\Event\ActionEvent $actionEvent )
triggerError ( Prooph\Common\Event\ActionEvent $actionEvent )
triggerFinalize ( Prooph\Common\Event\ActionEvent $actionEvent )

Method Details

deactivate() public method

public deactivate ( Prooph\Common\Event\ActionEventListenerAggregate $plugin )
$plugin Prooph\Common\Event\ActionEventListenerAggregate

dispatch() abstract public method

abstract public dispatch ( mixed $message ) : mixed | void
$message mixed
return mixed | void depends on the bus type

getActionEventEmitter() public method

Lazy-loads a dispatcher if none is registered.
public getActionEventEmitter ( ) : Prooph\Common\Event\ActionEventEmitter
return Prooph\Common\Event\ActionEventEmitter

getMessageName() protected method

protected getMessageName ( mixed $message ) : string
$message mixed
return string

handleException() protected method

protected handleException ( Prooph\Common\Event\ActionEvent $actionEvent, Exception $ex )
$actionEvent Prooph\Common\Event\ActionEvent
$ex Exception

initialize() protected method

protected initialize ( mixed $message, Prooph\Common\Event\ActionEvent $actionEvent )
$message mixed
$actionEvent Prooph\Common\Event\ActionEvent

setActionEventEmitter() public method

Inject an ActionEventDispatcher instance
public setActionEventEmitter ( Prooph\Common\Event\ActionEventEmitter $actionEventDispatcher ) : void
$actionEventDispatcher Prooph\Common\Event\ActionEventEmitter
return void

trigger() protected method

protected trigger ( Prooph\Common\Event\ActionEvent $actionEvent )
$actionEvent Prooph\Common\Event\ActionEvent

triggerError() protected method

protected triggerError ( Prooph\Common\Event\ActionEvent $actionEvent )
$actionEvent Prooph\Common\Event\ActionEvent

triggerFinalize() protected method

protected triggerFinalize ( Prooph\Common\Event\ActionEvent $actionEvent )
$actionEvent Prooph\Common\Event\ActionEvent

utilize() public method

public utilize ( Prooph\Common\Event\ActionEventListenerAggregate $plugin )
$plugin Prooph\Common\Event\ActionEventListenerAggregate

Property Details

$events protected property

protected ActionEventEmitter,Prooph\Common\Event $events
return Prooph\Common\Event\ActionEventEmitter