Help for this page

Select Code to Download


  1. or download this
    my $cv = AnyEvent->condvar;
    my $timer = AnyEvent->timer( after => 10, cb => sub { $cv->croak("Time
    +out"); };
    do_something( 
    ...
    my $result = $cv->recv();
    undef $timer; 
    analyze_do_something( $result );
    
  2. or download this
    my $result = ae_recv {
        do_something( 
            on_success => ae_send,
    ...
        );
    } 10; # timeout 
    analyze_do_something( $result );