| 1 | # You may distribute under the terms of either the GNU General Public License | ||
| 2 | # or the Artistic License (the same terms as Perl itself) | ||
| 3 | # | ||
| 4 | # (C) Paul Evans, 2014 -- leonerd@leonerd.org.uk | ||
| 5 | |||
| 6 | package Net::Async::Gearman::Client; | ||
| 7 | |||
| 8 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 2 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | 2 | our $VERSION = '0.01'; | |
| 12 | |||
| 13 | 2 | ▶ | use base qw( Net::Async::Gearman Protocol::Gearman::Client ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | |||
| 15 | =head1 NAME | ||
| 16 | |||
| 17 | C<Net::Async::Gearman::Client> - concrete Gearman client over an L<IO::Async::Stream> | ||
| 18 | |||
| 19 | =head1 SYNOPSIS | ||
| 20 | |||
| 21 | use IO::Async::Loop; | ||
| 22 | use Net::Async::Gearman::Client; | ||
| 23 | |||
| 24 | my $loop = IO::Async::Loop->new; | ||
| 25 | |||
| 26 | my $client = Net::Async::Gearman::Client->new; | ||
| 27 | $loop->add( $client ); | ||
| 28 | |||
| 29 | $client->connect( | ||
| 30 | host => $SERVER | ||
| 31 | )->then( sub { | ||
| 32 | $client->submit_job( | ||
| 33 | func => "sum", | ||
| 34 | arg => "10,20,30" | ||
| 35 | ) | ||
| 36 | })->then( sub { | ||
| 37 | my ( $total ) = @_; | ||
| 38 | say $total; | ||
| 39 | Future->done; | ||
| 40 | })->get; | ||
| 41 | |||
| 42 | =head1 DESCRIPTION | ||
| 43 | |||
| 44 | This module combines the abstract L<Protocol::Gearman::Client> with | ||
| 45 | L<Net::Async::Gearman> to provide an asynchronous concrete Gearman client | ||
| 46 | implementation. | ||
| 47 | |||
| 48 | It provides no new methods of its own; all of the Gearman functionality comes | ||
| 49 | from C<Protocol::Gearman::Client>. See that module's documentation for more | ||
| 50 | information. | ||
| 51 | |||
| 52 | =cut | ||
| 53 | |||
| 54 | =head1 AUTHOR | ||
| 55 | |||
| 56 | Paul Evans <leonerd@leonerd.org.uk> | ||
| 57 | |||
| 58 | =cut | ||
| 59 | |||
| 60 | 2 | 0x55AA; | |