Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

event::makemaker(3pm) [debian man page]

Event::MakeMaker(3pm)					User Contributed Perl Documentation				     Event::MakeMaker(3pm)

NAME
Event::MakeMaker - MakeMaker glue for the C-level Event API SYNOPSIS
This is an advanced feature of Event. DESCRIPTION
For optimal performance, hook into Event at the C-level. You'll need to make changes to your "Makefile.PL" and add code to your "xs" / "c" file(s). WARNING
When you hook in at the C-level you get a huge performance gain, but you also reduce the chances that your code will work unmodified with newer versions of "perl" or "Event". This may or may not be a problem. Just be aware, and set your expectations accordingly. HOW TO
Makefile.PL use Event::MakeMaker qw(event_args); # ... set up %args ... WriteMakefile(event_args(%args)); XS #include "EventAPI.h" BOOT: I_EVENT_API("YourModule"); API (v21) struct EventAPI { I32 Ver; /* EVENTS */ void (*queue )(pe_event *ev); void (*start )(pe_watcher *ev, int repeat); void (*now )(pe_watcher *ev); void (*stop )(pe_watcher *ev, int cancel_events); void (*cancel )(pe_watcher *ev); void (*suspend )(pe_watcher *ev); void (*resume )(pe_watcher *ev); /* All constructors optionally take a stash and template. Either or both can be NULL. The template should not be a reference. */ pe_idle *(*new_idle )(HV*, SV*); pe_timer *(*new_timer )(HV*, SV*); pe_io *(*new_io )(HV*, SV*); pe_var *(*new_var )(HV*, SV*); pe_signal *(*new_signal)(HV*, SV*); /* TIMEABLE */ void (*tstart)(pe_timeable *); void (*tstop)(pe_timeable *); /* HOOKS */ pe_qcallback *(*add_hook)(char *which, void *cb, void *ext_data); void (*cancel_hook)(pe_qcallback *qcb); /* STATS */ void (*install_stats)(pe_event_stats_vtbl *esvtbl); void (*collect_stats)(int yes); pe_ring *AllWatchers; /* TYPEMAP */ SV *(*watcher_2sv)(pe_watcher *wa); void *(*sv_2watcher)(SV *sv); SV *(*event_2sv)(pe_event *ev); void *(*sv_2event)(SV *sv); }; EXAMPLE static pe_io *X11_ev=0; static void x_server_dispatch(void *ext_data) { ... } if (!X11_ev) { X11_ev = GEventAPI->new_io(0,0); X11_ev->poll = PE_R; sv_setpv(X11_ev->base.desc, "X::Server"); X11_ev->base.callback = (void*) x_server_dispatch; X11_ev->base.ext_data = <whatever>; X11_ev->base.prio = PE_PRIO_NORMAL; } X11_ev->fd = x_fd; GEventAPI->resume((pe_event*) X11_ev); GEventAPI->start((pe_event*) X11_ev, 0); BUT I NEED A NEW TYPE OF WATCHER FOR MY INTERGALACTIC INFEROMETER I'd prefer not to export the entire Event.h apparatus in favor of minimizing interdependencies. If you really, really need to create a new type of watcher send your problem analysis to the mailing list! perl v5.14.2 2007-05-22 Event::MakeMaker(3pm)

Check Out this Related Man Page

Event::generic(3pm)					User Contributed Perl Documentation				       Event::generic(3pm)

NAME
Event::generic - generic event handling SYNOPSIS
use Event::generic; $source = Event::generic::Source->new; $w = Event->generic(source => $source, ...); $w = $source->watch(...); $source = $w->source; $w->source($source); $source->event; $source->event($data); $data = $event->data; DESCRIPTION
This module provides a watcher type within the "Event" framework. You must understand the architecture of the "Event" system in order to understand this document. This module provides a system of reified event sources and watchers watching those sources. Events are generated solely by a method on the event source object. The events may carry arbitrary data to the event handler callbacks. This module is intended for situations where the events of interest are best determined by Perl code. CLASSES
Event::generic::Source A reified event source. Event::generic A watcher that can watch "Event::generic::Source" event sources. Event::Event::Dataful A (target) event that can carry arbitrary data. EVENT SOURCE CLASS
Constructor Event::generic::Source->new Creates and returns a new event source. Methods $source->event $source->event(DATA) The invocation of this method is a source event for watchers of the event source. When this method is called, each active watcher of the event source generates a target event. The DATA, if supplied, is copied into the target event objects, from which it can be retrieved using the "data()" method. $source->watch(ATTR => VALUE, ...) Generates and returns a new watcher, configured to watch this event source. The standard watcher attributes may be specified as arguments. The watcher returned is an ordinary "Event::generic", and may be reconfigured to watch a different event source. WATCHER CLASS
Type-specific attributes source => $source The event source to watch. This must be either an "Event::generic::Source" object or "undef". When set to "undef", no source is being watched, and the watcher cannot be started. EVENT CLASS
Type-specific methods $event->data Returns the data associated with the event, which may be any scalar. This is read-only, and is set by the event source. SEE ALSO
Event perl v5.14.2 2007-05-22 Event::generic(3pm)
Man Page