GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Event::generic(3) User Contributed Perl Documentation Event::generic(3)

Event::generic - generic event handling

 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;

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.

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::generic::Source->new
Creates and returns a new event source.

$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.

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->data
Returns the data associated with the event, which may be any scalar. This is read-only, and is set by the event source.

Event
2018-11-17 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.