AnyEvent-Handle-Throttle

 view release on metacpan or  search on metacpan

t/http.t  view on Meta::CPAN

use strict;
use warnings;
use Test::More;
use AnyEvent::Impl::Perl;
use AnyEvent;
use lib '../lib';
use AnyEvent::Handle::Throttle;
$|++;
my $condvar = AnyEvent->condvar;
my ($handle, $rbuf, $prev, $chunks);
my $req = "GET / HTTP/1.0\015\012\015\012";
TODO: {
    local $TODO = 'May fail blah blah blah';
    $handle = new_ok(
        'AnyEvent::Handle::Throttle',
        [upload_limit   => 2,

t/http_default.t  view on Meta::CPAN

use strict;
use warnings;
use Test::More;
use AnyEvent::Impl::Perl;
use AnyEvent;
use lib '../lib';
use AnyEvent::Handle::Throttle;
$|++;
my $condvar = AnyEvent->condvar;
my ($prev, $chunks, $handle, $rbuf) = (AE::now, 0, undef, undef);
my $req = "GET / HTTP/1.0\015\012\015\012";
TODO: {
    local $TODO = 'May fail blah blah blah';
    $handle = new_ok(
        'AnyEvent::Handle::Throttle',
        [connect    => ['cpan.org', 80],

t/http_global.t  view on Meta::CPAN

use strict;
use warnings;
use Test::More;
use AnyEvent::Impl::Perl;
use AnyEvent;
use lib '../lib';
use AnyEvent::Handle::Throttle;
$|++;
my $condvar = AnyEvent->condvar;
my ($prev, $chunks, $handle, $rbuf) = (AE::now, 0, undef, undef);
my $req = "GET / HTTP/1.0\015\012\015\012";
AnyEvent::Handle::Throttle->global_upload_limit(5);
AnyEvent::Handle::Throttle->global_download_limit(200);
TODO: {
    local $TODO = 'May fail blah blah blah';
    $handle = new_ok(

t/loopback.t  view on Meta::CPAN

use strict;
use warnings;
use Test::More;
use AnyEvent::Impl::Perl;
use lib '../lib';
use AnyEvent::Handle::Throttle;
use Socket;
$|++;
my $cv = AnyEvent->condvar;
my ($read, $write, $onekchunks, $dat);
my $now = AE::now;
my $len = 0;
socketpair my $rd, my $wr, AF_UNIX, SOCK_STREAM, PF_UNSPEC;
my $wr_ae = AnyEvent::Handle::Throttle->new(
    fh     => $wr,



( run in 0.379 second using v1.01-cache-2.11-cpan-87723dcf8b7 )