{
    "mode": "perldoc",
    "parameter": "Test2::Event::Generic",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Test2%3A%3AEvent%3A%3AGeneric/json",
    "generated": "2026-06-17T01:23:11Z",
    "synopsis": "use Test2::API qw/context/;\nsub sendcustomfail {\nmy $ctx = shift;\n$ctx->sendevent('Generic', causesfail => 1, summary => 'The sky is falling');\n$ctx->release;\n}\nsendcustomfail();",
    "sections": {
        "NAME": {
            "content": "Test2::Event::Generic - Generic event type.\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This is a generic event that lets you customize all fields in the event API. This is useful if\nyou have need for a custom event that does not make sense as a published reusable event\nsubclass.\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use Test2::API qw/context/;\n\nsub sendcustomfail {\nmy $ctx = shift;\n\n$ctx->sendevent('Generic', causesfail => 1, summary => 'The sky is falling');\n\n$ctx->release;\n}\n\nsendcustomfail();\n",
            "subsections": []
        },
        "METHODS": {
            "content": "$e->facetdata($data)\n$data = $e->facetdata\nGet or set the facet data (see Test2::Event). If no facetdata is set then\n\"Test2::Event->facetdata\" will be called to produce facets from the other data.\n\n$e->callback($hub)\nCall the custom callback if one is set, otherwise this does nothing.\n\n$e->setcallback(sub { ... })\nSet the custom callback. The custom callback must be a coderef. The first argument to your\ncallback will be the event itself, the second will be the Test2::Event::Hub that is using\nthe callback.\n\n$bool = $e->causesfail\n$e->setcausesfail($bool)\nGet/Set the \"causesfail\" attribute. This defaults to 0.\n\n$bool = $e->diagnostics\n$e->setdiagnostics($bool)\nGet/Set the \"diagnostics\" attribute. This defaults to 0.\n\n$boolorundef = $e->global\n@boolorempty = $e->global\n$e->setglobal($boolorundef)\nGet/Set the \"diagnostics\" attribute. This defaults to an empty list which is undef in scalar\ncontext.\n\n$bool = $e->incrementscount\n$e->setincrementscount($bool)\nGet/Set the \"incrementscount\" attribute. This defaults to 0.\n\n$bool = $e->nodisplay\n$e->setnodisplay($bool)\nGet/Set the \"nodisplay\" attribute. This defaults to 0.\n\n@plan = $e->setsplan\nGet the plan if this event sets one. The plan is a list of up to 3 items: \"($count,\n$directive, $reason)\". $count must be defined, the others may be undef, or may not exist at\nall.\n\n$e->setsetsplan(\\@plan)\nSet the plan. You must pass in an arrayref with up to 3 elements.\n\n$summary = $e->summary\n$e->setsummary($summaryorundef)\nGet/Set the summary. This will default to the event package 'Test2::Event::Generic'. You can\nset it to any value. Setting this to \"undef\" will reset it to the default.\n\n$intorundef = $e->terminate\n@intorempty = $e->terminate\n$e->setterminate($intorundef)\nThis will get/set the \"terminate\" attribute. This defaults to undef in scalar context, or an\nempty list in list context. Setting this to undef will clear it completely. This must be set\nto a positive integer (0 or larger).\n",
            "subsections": []
        },
        "SOURCE": {
            "content": "The source code repository for Test2 can be found at http://github.com/Test-More/test-more/.\n",
            "subsections": []
        },
        "MAINTAINERS": {
            "content": "Chad Granum <exodist@cpan.org>\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "Chad Granum <exodist@cpan.org>\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright 2020 Chad Granum <exodist@cpan.org>.\n\nThis program is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n\nSee http://dev.perl.org/licenses/\n",
            "subsections": []
        }
    },
    "summary": "Test2::Event::Generic - Generic event type.",
    "flags": [],
    "examples": [],
    "see_also": []
}