{
    "content": [
        {
            "type": "text",
            "text": "# Event::generic (perldoc)\n\n## NAME\n\nEvent::generic - generic event handling\n\n## SYNOPSIS\n\nuse Event::generic;\n$source = Event::generic::Source->new;\n$w = Event->generic(source => $source, ...);\n$w = $source->watch(...);\n$source = $w->source;\n$w->source($source);\n$source->event;\n$source->event($data);\n$data = $event->data;\n\n## DESCRIPTION\n\nThis module provides a watcher type within the \"Event\" framework. You must understand the\narchitecture of the \"Event\" system in order to understand this document.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **CLASSES**\n- **EVENT SOURCE CLASS** (2 subsections)\n- **WATCHER CLASS** (1 subsections)\n- **EVENT CLASS** (1 subsections)\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Event::generic",
        "section": "",
        "mode": "perldoc",
        "summary": "Event::generic - generic event handling",
        "synopsis": "use Event::generic;\n$source = Event::generic::Source->new;\n$w = Event->generic(source => $source, ...);\n$w = $source->watch(...);\n$source = $w->source;\n$w->source($source);\n$source->event;\n$source->event($data);\n$data = $event->data;",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 15,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "CLASSES",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "EVENT SOURCE CLASS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "Constructor",
                        "lines": 3
                    },
                    {
                        "name": "Methods",
                        "lines": 12
                    }
                ]
            },
            {
                "name": "WATCHER CLASS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "Type-specific attributes",
                        "lines": 4
                    }
                ]
            },
            {
                "name": "EVENT CLASS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "Type-specific methods",
                        "lines": 4
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Event::generic - generic event handling\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Event::generic;\n\n$source = Event::generic::Source->new;\n\n$w = Event->generic(source => $source, ...);\n$w = $source->watch(...);\n\n$source = $w->source;\n$w->source($source);\n\n$source->event;\n$source->event($data);\n\n$data = $event->data;\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This module provides a watcher type within the \"Event\" framework. You must understand the\narchitecture of the \"Event\" system in order to understand this document.\n\nThis module provides a system of reified event sources and watchers watching those sources.\nEvents are generated solely by a method on the event source object. The events may carry\narbitrary data to the event handler callbacks. This module is intended for situations where the\nevents of interest are best determined by Perl code.\n",
                "subsections": []
            },
            "CLASSES": {
                "content": "Event::generic::Source\nA reified event source.\n\nEvent::generic\nA watcher that can watch \"Event::generic::Source\" event sources.\n\nEvent::Event::Dataful\nA (target) event that can carry arbitrary data.\n",
                "subsections": []
            },
            "EVENT SOURCE CLASS": {
                "content": "",
                "subsections": [
                    {
                        "name": "Constructor",
                        "content": "Event::generic::Source->new\nCreates and returns a new event source.\n"
                    },
                    {
                        "name": "Methods",
                        "content": "$source->event\n$source->event(DATA)\nThe invocation of this method is a source event for watchers of the event source. When this\nmethod is called, each active watcher of the event source generates a target event. The\n*DATA*, if supplied, is copied into the target event objects, from which it can be retrieved\nusing the \"data()\" method.\n\n$source->watch(ATTR => VALUE, ...)\nGenerates and returns a new watcher, configured to watch this event source. The standard\nwatcher attributes may be specified as arguments. The watcher returned is an ordinary\n\"Event::generic\", and may be reconfigured to watch a different event source.\n"
                    }
                ]
            },
            "WATCHER CLASS": {
                "content": "",
                "subsections": [
                    {
                        "name": "Type-specific attributes",
                        "content": "source => $source\nThe event source to watch. This must be either an \"Event::generic::Source\" object or\n\"undef\". When set to \"undef\", no source is being watched, and the watcher cannot be started.\n"
                    }
                ]
            },
            "EVENT CLASS": {
                "content": "",
                "subsections": [
                    {
                        "name": "Type-specific methods",
                        "content": "$event->data\nReturns the data associated with the event, which may be any scalar. This is read-only, and\nis set by the event source.\n"
                    }
                ]
            },
            "SEE ALSO": {
                "content": "Event\n",
                "subsections": []
            }
        }
    }
}