On Wed, 2004-12-01 at 01:23 +0000, Zefram wrote:
> +=head1 SYNOPSIS
> +
> + use Event::generic;
> +
> + $source = Event::generic::Source->new;
> +
> + $w = Event->generic(source => $source, ...);
> + $w = $source->watch(...);
> +
> + $source = $w->source;
> + $w->source($source);
> +
> + @watchers = $source->active_watchers;
> +
> + $source->event;
> + $source->event($data);
> +
> + $data = $event->data;

What is the point of the Event::generic::Source class?

It seems like there is only one really important method in the class --
"event" to create a new event.  So what I'm thinking is why not just add
this method to the generic watcher class?  Wouldn't that simplify
things?

The usage above just seems big and clunky, over-engineered perhaps.  For
example, how about only:

$w = Event->generic();
$w->create_event([qw(a b c)]);
warn $event->data->[1];   # b

?


Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to