| 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,2026 -- leonerd@leonerd.org.uk | ||
| 5 | |||
| 6 | package Net::Async::Gearman::Client 0.02; | ||
| 7 | |||
| 8 | 2 | ▶ | use v5.20; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 2 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | 2 | ▶ | use base qw( Net::Async::Gearman Protocol::Gearman::Client ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | |||
| 13 | =head1 NAME | ||
| 14 | |||
| 15 | C<Net::Async::Gearman::Client> - concrete Gearman client over an L<IO::Async::Stream> | ||
| 16 | |||
| 17 | =head1 SYNOPSIS | ||
| 18 | |||
| 19 | =for highlighter language=perl | ||
| 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 | await $client->connect( | ||
| 30 | host => $SERVER, | ||
| 31 | ); | ||
| 32 | |||
| 33 | my $total = await $client->submit_job( | ||
| 34 | func => "sum", | ||
| 35 | arg => "10,20,30", | ||
| 36 | ); | ||
| 37 | |||
| 38 | say $total; | ||
| 39 | |||
| 40 | =head1 DESCRIPTION | ||
| 41 | |||
| 42 | This module combines the abstract L<Protocol::Gearman::Client> with | ||
| 43 | L<Net::Async::Gearman> to provide an asynchronous concrete Gearman client | ||
| 44 | implementation. | ||
| 45 | |||
| 46 | It provides no new methods of its own; all of the Gearman functionality comes | ||
| 47 | from C<Protocol::Gearman::Client>. See that module's documentation for more | ||
| 48 | information. | ||
| 49 | |||
| 50 | =cut | ||
| 51 | |||
| 52 | =head1 AUTHOR | ||
| 53 | |||
| 54 | Paul Evans <leonerd@leonerd.org.uk> | ||
| 55 | |||
| 56 | =cut | ||
| 57 | |||
| 58 | 2 | 0x55AA; | |