```{index} single: Event::group ``` # Event::group ```{pperl-module-badges} Event::group ``` A group watcher: an event when none of its member watchers has run its callback for `timeout` seconds - a watchdog over a set of watchers. `use Event` does not load this watcher type; `use Event::group` does (`Event->group` without it still works, with a warning that autoloading is deprecated). `Event->group(%attributes)` (or `Event::group->new(...)`) takes the shared attributes of `Event::Watcher`, `timeout`, and any number of `add => $watcher` pairs; `del` there is ignored with a warning. A group repeats. It refuses to start without a callback, or without a `timeout` ("repeating group has no timeout"). ## Synopsis ```perl use Event; use Event::group; my $in = Event->io(fd => \*STDIN, cb => \&read_input); my $tick = Event->timer(interval => 5, cb => \&poll_server); Event->group(add => $in, add => $tick, timeout => 60, cb => sub { warn "nothing happened for a minute\n" }); Event::loop(); ``` ## Functions ### Attributes #### `timeout` Seconds of silence after which the group fires: a number, or a reference to a number. A negative value warns and counts as 0; anything else that is not a number dies. #### `add` `$group->add($watcher)` makes `$watcher` a member; returns nothing. Adding the group to itself dies "can't add group 'DESC' to itself". #### `del` `$group->del($watcher)` removes a member; returns nothing. A watcher that is not a member is ignored.