{
    "mode": "perldoc",
    "parameter": "Event::MakeMaker",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Event%3A%3AMakeMaker/json",
    "generated": "2026-06-12T18:23:52Z",
    "synopsis": "This is an advanced feature of Event.",
    "sections": {
        "NAME": {
            "content": "Event::MakeMaker - MakeMaker glue for the C-level Event API\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "This is an advanced feature of Event.\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "For optimal performance, hook into Event at the C-level. You'll need to make changes to your\n\"Makefile.PL\" and add code to your \"xs\" / \"c\" file(s).\n",
            "subsections": []
        },
        "WARNING": {
            "content": "When you hook in at the C-level you get a *huge* performance gain, but you also reduce the\nchances that your code will work unmodified with newer versions of \"perl\" or \"Event\". This may\nor may not be a problem. Just be aware, and set your expectations accordingly.\n",
            "subsections": []
        },
        "HOW TO": {
            "content": "",
            "subsections": [
                {
                    "name": "Makefile.PL",
                    "content": "use Event::MakeMaker qw(eventargs);\n\n# ... set up %args ...\n\nWriteMakefile(eventargs(%args));\n\nXS\n#include \"EventAPI.h\"\n\nBOOT:\nIEVENTAPI(\"YourModule\");\n\nAPI (v21)\nstruct EventAPI {\nI32 Ver;\n\n/* EVENTS */\nvoid (*queue   )(peevent *ev);\nvoid (*start   )(pewatcher *ev, int repeat);\nvoid (*now     )(pewatcher *ev);\nvoid (*stop    )(pewatcher *ev, int cancelevents);\nvoid (*cancel  )(pewatcher *ev);\nvoid (*suspend )(pewatcher *ev);\nvoid (*resume  )(pewatcher *ev);\n\n/* All constructors optionally take a stash and template.  Either\nor both can be NULL.  The template should not be a reference. */\npeidle     *(*newidle  )(HV*, SV*);\npetimer    *(*newtimer )(HV*, SV*);\npeio       *(*newio    )(HV*, SV*);\npevar      *(*newvar   )(HV*, SV*);\npesignal   *(*newsignal)(HV*, SV*);\n\n/* TIMEABLE */\nvoid (*tstart)(petimeable *);\nvoid (*tstop)(petimeable *);\n\n/* HOOKS */\npeqcallback *(*addhook)(char *which, void *cb, void *extdata);\nvoid (*cancelhook)(peqcallback *qcb);\n\n/* STATS */\nvoid (*installstats)(peeventstatsvtbl *esvtbl);\nvoid (*collectstats)(int yes);\npering *AllWatchers;\n\n/* TYPEMAP */\nSV   *(*watcher2sv)(pewatcher *wa);\nvoid *(*sv2watcher)(SV *sv);\nSV   *(*event2sv)(peevent *ev);\nvoid *(*sv2event)(SV *sv);\n};\n\nEXAMPLE\nstatic peio *X11ev=0;\n\nstatic void xserverdispatch(void *extdata)\n{ ... }\n\nif (!X11ev) {\nX11ev = GEventAPI->newio(0,0);\nX11ev->poll = PER;\nsvsetpv(X11ev->base.desc, \"X::Server\");\nX11ev->base.callback = (void*) xserverdispatch;\nX11ev->base.extdata = <whatever>;\nX11ev->base.prio = PEPRIONORMAL;\n}\nX11ev->fd = xfd;\nGEventAPI->resume((peevent*) X11ev);\nGEventAPI->start((peevent*) X11ev, 0);\n\nBUT I NEED A NEW TYPE OF WATCHER FOR MY INTERGALACTIC INFEROMETER\nI'd prefer not to export the entire Event.h apparatus in favor of minimizing interdependencies.\nIf you really, really need to create a new type of watcher send your problem analysis to the\nmailing list!\n"
                }
            ]
        }
    },
    "summary": "Event::MakeMaker - MakeMaker glue for the C-level Event API",
    "flags": [],
    "examples": [],
    "see_also": []
}