Test2::Event::Generic - Generic event type.
This is a generic event that lets you customize all fields in the event API. This is useful if you have need for a custom event that does not make sense as a published reusable event subclass.
use Test2::API qw/context/;
sub send_custom_fail {
my $ctx = shift;
$ctx->send_event('Generic', causes_fail => 1, summary => 'The sky is falling');
$ctx->release;
}
send_custom_fail();
Get or set the facet data (see Test2::Event). If no facet_data is set then Test2::Event->facet_data
will be called to produce facets from the other data.
Call the custom callback if one is set, otherwise this does nothing.
Set the custom callback. The custom callback must be a coderef. The first argument to your callback will be the event itself, the second will be the Test2::Event::Hub that is using the callback.