File Coverage

blib/lib/AnyEvent/ZeroMQ/Request.pm
Criterion Covered Total %
statement 2 4 50.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 4 6 66.6


line stmt bran cond sub pod time code
1             package AnyEvent::ZeroMQ::Request;
2             BEGIN {
3 1     1   5867 $AnyEvent::ZeroMQ::Request::VERSION = '0.01';
4             }
5             # ABSTRACT: Non-blocking OO abstraction over ZMQ_REQ request/reply sockets
6 1     1   513 use Moose;
  0            
  0            
7             use true;
8             use namespace::autoclean;
9             use ZeroMQ::Raw::Constants qw(ZMQ_REQ);
10              
11             with 'AnyEvent::ZeroMQ::Role::WithHandle' =>
12             { socket_type => ZMQ_REQ, socket_direction => '' };
13              
14             sub push_request {
15             my ($self, $req, $handler, $hint) = @_;
16             if(defined $hint){
17             $self->handle->push_read(sub {
18             $handler->(@_, $hint);
19             });
20             }
21             else {
22             $self->handle->push_read($handler);
23             }
24             $self->handle->push_write($req);
25             }
26              
27             with 'AnyEvent::ZeroMQ::Handle::Role::Generic';
28              
29             __PACKAGE__->meta->make_immutable;
30              
31             __END__
32             =pod
33              
34             =head1 NAME
35              
36             AnyEvent::ZeroMQ::Request - Non-blocking OO abstraction over ZMQ_REQ request/reply sockets
37              
38             =head1 VERSION
39              
40             version 0.01
41              
42             =head1 AUTHOR
43              
44             Jonathan Rockway <jrockway@cpan.org>
45              
46             =head1 COPYRIGHT AND LICENSE
47              
48             This software is copyright (c) 2011 by Jonathan Rockway.
49              
50             This is free software; you can redistribute it and/or modify it under
51             the same terms as the Perl 5 programming language system itself.
52              
53             =cut
54