{"id":30211296,"url":"https://github.com/mons/event-emitter","last_synced_at":"2025-08-13T20:35:52.082Z","repository":{"id":136416703,"uuid":"2662200","full_name":"Mons/Event-Emitter","owner":"Mons","description":"Glue for event-driven programming, inside out","archived":false,"fork":false,"pushed_at":"2015-06-18T16:51:50.000Z","size":200,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-03-10T20:33:10.003Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://seqrch.cpan.org/dist/Event-Emitter","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Mons.png","metadata":{"files":{"readme":"README","changelog":"Changes","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-10-28T00:20:41.000Z","updated_at":"2023-03-12T23:01:55.921Z","dependencies_parsed_at":"2023-03-13T11:03:11.645Z","dependency_job_id":null,"html_url":"https://github.com/Mons/Event-Emitter","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/Mons/Event-Emitter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mons%2FEvent-Emitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mons%2FEvent-Emitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mons%2FEvent-Emitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mons%2FEvent-Emitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mons","download_url":"https://codeload.github.com/Mons/Event-Emitter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mons%2FEvent-Emitter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270305881,"owners_count":24562111,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-13T02:00:09.904Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-08-13T20:34:28.297Z","updated_at":"2025-08-13T20:35:52.028Z","avatar_url":"https://github.com/Mons.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"NAME\n    Event::Emitter - Glue for event-driven programming, inside out\n\nSYNOPSIS\n        package Sample;\n        use Event::Emitter;\n\n        sub new { ... }\n\n        package main;\n\n        my $o = Sample-\u003enew;\n        $o-\u003eon(\n        event =\u003e sub { ... }\n        );\n\n        $o-\u003eevent(event =\u003e @args);\n\n        $o-\u003eno('event');\n\nDESCRIPTION\n    This module is something between Object::Event and Node.js'\n    EventEmitter.\n\n    The differences from Object::Event are:\n\n    Event::Emitter not affects object structure or content. All things about\n    events stored outside object\n    Event::Emitter uses interface similar to Node.js' EventEmitter (for ex\n    \"on()\" instead of \"reg_cb()\" )\n    Event::Emitter uses opposite order when calling events, registered under\n    same name. \"OE\" uses \"FIFO\", \"EE\" uses \"LIFO\"\n    Event::Emitter does not implement attributes.\n    Event::Emitter does not set itself as a base class (could be changed\n    with \"-base\" flag).\n\nMETHODS\n    [ $guard = ] $obj-\u003eon( $event_name, [$prio], $cb )\n        Register one or more event handler\n\n            $obj-\u003eon( $event_name, [$prio], $cb, [ $event_name, [$prio], $cb, ... ] );\n            # or with guard\n            my $guard = $obj-\u003eon( $event_name, [$prio], $cb);\n            ...\n            undef $guard;\n\n    $obj-\u003eonce( $event_name, [$prio], $cb)\n        Register event handler for single run\n\n            $obj-\u003eonce( $event_name, [$prio], $cb );\n            $obj-\u003eevent($event_name); # $cb called\n            $obj-\u003eevent($event_name); # $cb not called\n\n    $obj-\u003eno(...)\n        Unregister event\n\n            $obj-\u003eno($cb);    # Unregister by callback\n            $obj-\u003eno('name'); # Unregister all events by name\n            $obj-\u003eno();       # Unregister all events\n\n    $obj-\u003ehandles($event_name);\n        Return true, if event would handled by $obj\n\n    $obj-\u003ehandled()\n        Stop processing current event chain.\n\n        my $x = X-\u003enew;\n        $x-\u003eon(sample =\u003e sub { say \"sample 1\"  });\n        $x-\u003eon(sample =\u003e sub { say \"sample 2\"; $x-\u003ehandled; });\n        $x-\u003eon(sample =\u003e sub { say \"sample 3\"  });\n        $x-\u003eevent('sample');\n\n        # Will output\n        sample 3\n        sample 2\n\n    $obj-\u003eevent($event_name,@args); =item $obj-\u003eemit($event_name,@args);\n        Emit event $event_name and call every handler in chain.\n\n    $obj-\u003eon(__DIE__, $cb)\n        Set exception handler. \"__DIE__\" is just a special name\n\n  Compatibility with Object::Event\n    Event::Emitter implements compatibility methods with Object::Event. It\n    is enabled with \"-oecompat\" flag:\n\n        use Event::Emitter -base, -oecompat;\n\n    reg_cb(...) as on(...)\n    unreg_cb(...) as no(...)\n    set_exception_cb($cb) as on(__DIE__,$cb)\n    remove_all_callbacks() as no()\n\n    1. Process events as fast as possible 2. Event addition 3. Event\n    deletion (what about once events?)\n\nAUTHOR\n    Mons Anderson \u003cmons@cpan.org\u003e\n\nLICENSE\n    This program is free software; you can redistribute it and/or modify it\n    under the terms of either: the GNU General Public License as published\n    by the Free Software Foundation; or the Artistic License.\n\nCOPYRIGHT\n    Copyright 2011 Mons Anderson, all rights reserved.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmons%2Fevent-emitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmons%2Fevent-emitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmons%2Fevent-emitter/lists"}