Changeset 13200

Show
Ignore:
Timestamp:
06/04/08 15:22:28 (7 years ago)
Author:
daisuke
Message:

move condvar and handle exception

Location:
lang/perl/XMPP-Bomber/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/XMPP-Bomber/trunk/lib/XMPP/Bomber/Client/Flooder.pm

    r13199 r13200  
    55 
    66with 'XMPP::Bomber::Role::Client'; 
    7  
    8 has 'condvar' => ( 
    9     is => 'rw', 
    10     default => sub { AnyEvent->condvar } 
    11 ); 
    127 
    138has 'max_delay' => ( 
     
    6459    $cb->(); 
    6560    $client->start(); 
    66          
    6761    $self->condvar->wait; 
    6862} 
  • lang/perl/XMPP-Bomber/trunk/lib/XMPP/Bomber/Role/Client.pm

    r13197 r13200  
    2525); 
    2626 
     27has 'condvar' => ( 
     28    is => 'rw', 
     29    default => sub { AnyEvent->condvar } 
     30); 
     31 
    2732has 'content_provider' => ( 
    2833    is => 'rw', 
     
    4146 
    4247    my $client = Net::XMPP2::Client->new( $self->xmpp_args ); 
     48 
     49    $client->set_exception_cb( sub { 
     50        print STDERR "Received exception $_[0]\n"; 
     51        $self->condvar->broadcast 
     52    } ); 
    4353    my $server = $self->server; 
    4454 
  • lang/perl/XMPP-Bomber/trunk/t/client/01_flood.t

    r13198 r13200  
    55{ 
    66    use_ok("XMPP::Bomber::Client::Flooder"); 
     7    use_ok("XMPP::Bomber::ContentProvider::Gibberish"); 
    78} 
    89 
     
    1819                password => "bar", 
    1920            ) 
    20         ] 
     21        ], 
     22        content_provider => XMPP::Bomber::ContentProvider::Gibberish->new() 
    2123    ); 
    2224