PHP Class PHPDaemon\PubSub\PubSubEvent

Author: Vasily Zorin ([email protected])
Inheritance: extends SplObjectStorage, use trait PHPDaemon\Traits\ClassWatchdog, use trait PHPDaemon\Traits\StaticObjectWatchdog
Datei anzeigen Open project: kakserpom/phpdaemon Class Usage Examples

Public Properties

Property Type Description
$actCb Activation callback
$deactCb Deactivation callback
$sub Subscriptions

Protected Properties

Property Type Description
$storage

Public Methods

Method Description
__construct ( $act = null, $deact = null ) Constructor
init ( ) : object Init
onActivation ( callable $cb ) : this Sets onActivation callback
onDeactivation ( callable $cb ) : this Sets onDeactivation callback
pub ( mixed $data ) : this Publish
sub ( object $obj, callable $cb ) : this Subscribe
unsub ( object $obj ) : this Unsubscripe

Method Details

__construct() public method

Constructor
public __construct ( $act = null, $deact = null )

init() public static method

Init
public static init ( ) : object
return object

onActivation() public method

Sets onActivation callback
public onActivation ( callable $cb ) : this
$cb callable Callback
return this

onDeactivation() public method

Sets onDeactivation callback
public onDeactivation ( callable $cb ) : this
$cb callable Callback
return this

pub() public method

Publish
public pub ( mixed $data ) : this
$data mixed Data
return this

sub() public method

Subscribe
public sub ( object $obj, callable $cb ) : this
$obj object Subcriber object
$cb callable Callback
return this

unsub() public method

Unsubscripe
public unsub ( object $obj ) : this
$obj object Subscriber object
return this

Property Details

$actCb public_oe property

Activation callback
public $actCb

$deactCb public_oe property

Deactivation callback
public $deactCb

$storage protected_oe property

protected $storage

$sub public_oe property

Subscriptions
public $sub