File: group.t

package info (click to toggle)
libevent-perl 1.06-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 712 kB
  • ctags: 588
  • sloc: ansic: 3,020; perl: 1,128; makefile: 46
file content (25 lines) | stat: -rw-r--r-- 564 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!./perl -w

use strict;
use Test; plan test => 6;
use Event qw(time);
require Event::group;

my $g = Event->group(parked=>1, timeout => 1.95, cb => sub {
			 my $e = shift;
			 warn "timeout at ".$e->w->cbtime;
		     },
		     add => Event->timer(desc => '1', interval => 2,
					 cb => sub {
					     my $e = shift;
					     warn "boink #1 at ".$e->w->cbtime
					 }),
		     add => Event->timer(desc => '2', interval => 2.5,
					 cb => sub {
					     my $e = shift;
					     warn "boink #2 at ".$e->w->cbtime
					 }),
		    );
$g->start;

Event::loop();