Event::Event#

📦 max

An event, as a callback receives it: one occurrence (or several, merged) of what a watcher watches. loop calls the watcher’s callback with the event as its only argument.

Events of io and var watchers are Event::Event::Io objects, which add got; events of generic watchers are Event::Event::Dataful objects, which add data. Both are subclasses of Event::Event.

Synopsis#

use Event;

Event->io(fd => \*STDIN, poll => 'r', cb => sub {
    my $e = shift;
    printf "%s: %s, %d hit(s) at priority %d\n",
        $e->w->desc, $e->got, $e->hits, $e->prio;
    Event::unloop() if eof STDIN;
});
Event::loop();

Modules#

Functions#

Attributes#

mom#

The old name of w. Returns the same; the first 16 calls in a program also warn “‘mom’ renamed to ‘w’”.

w#

The watcher that generated the event. Read-only.

hits#

How many occurrences this event stands for. Signals arriving in quick succession are merged into one event; for the other watcher types it is usually 1.

prio#

The priority the event was queued at. It can differ from the watcher’s current prio: the watcher’s may have changed since, and Event::queue and the C API can queue at any priority.