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 26 27 28 29 30 31 32 33
|
use Test::More tests => 10;
use Mojo::RabbitMQ::Client::LocalQueue;
my $q = Mojo::RabbitMQ::Client::LocalQueue->new;
$q->push(1);
$q->get(sub {is $_[0], 1, 'push -> get';});
$q->get(sub {is $_[0], 2, 'get -> push';});
$q->push(2);
$q->push(3, 4);
$q->push(5, 6);
$q->get(
sub {is $_[0], 3, '';},
sub {is $_[0], 4, '';},
);
$q->get(
sub {is $_[0], 5, '';},
sub {is $_[0], 6, '';},
);
$q->get(
sub {is $_[0], 7, '';},
sub {is $_[0], 8, '';},
);
$q->get(
sub {is $_[0], 9, '';},
sub {is $_[0], 10, '';},
);
$q->push(7, 8);
$q->push(9, 10);
|