xp_erase_signal_history

xp_erase_signal_history($signal)

Erases the history of only the given signal.

Warning

This will delete the history for ANY signals that are a direct child of the to be deleted signal.

As an example,

When sig_foo emits it is proceeded directly by sig_foo2 emitting within the sig_foo execution.

When sig_foo is deleted the history of sig_foo_child will also be removed.

Parameters:string|object – Signal to be erased from history.
Return type:void

Example #1 Basic Usage

<?php

// Install a procss for the foo and bar signals.
xp_signal(XP_SIG('foo'), function(){});
xp_signal(XP_SIG('bar'), function(){});
// Emit each foo and bar 10 times.
for($i=0;$i<10;$i++) {
    xp_emit(XP_SIG('foo'));
    xp_emit(XP_SIG('bar'));
}
var_dump(count(xp_signal_history()));
// Delete the history of the foo signal.
xp_delete_signal_history(XP_SIG('foo'));
var_dump(count(xp_signal_history()));

The above code will output.

20 ... 10
Read the Docs v: v5.0.1
Versions
latest
v5.0.1
v5.0.0
v4.0.1
v4.0.0
v3.1.1
v3.1.0
v3.0.0
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.