| 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::Gearman::Client 0.05; | ||
| 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 feature qw( postderef signatures ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | 2 | ▶ | no warnings qw( experimental::postderef experimental::signatures ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | |||
| 14 | 2 | ▶ | use base qw( Net::Gearman Protocol::Gearman::Client ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | |||
| 16 | =head1 NAME | ||
| 17 | |||
| 18 | C<Net::Gearman::Client> - concrete Gearman client over an IP socket | ||
| 19 | |||
| 20 | =head1 SYNOPSIS | ||
| 21 | |||
| 22 | =for highlighter language=perl | ||
| 23 | |||
| 24 | use Net::Gearman::Client; | ||
| 25 | |||
| 26 | my $client = Net::Gearman::Client->new( | ||
| 27 | PeerAddr => $SERVER, | ||
| 28 | ) or die "Cannot connect - $@\n"; | ||
| 29 | |||
| 30 | my $total = await $client->submit_job( | ||
| 31 | func => "sum", | ||
| 32 | arg => "10,20,30", | ||
| 33 | ); | ||
| 34 | |||
| 35 | say $total; | ||
| 36 | |||
| 37 | =head1 DESCRIPTION | ||
| 38 | |||
| 39 | This module combines the abstract L<Protocol::Gearman::Client> with | ||
| 40 | L<Net::Gearman> to provide a simple synchronous concrete client | ||
| 41 | implementation. | ||
| 42 | |||
| 43 | =cut | ||
| 44 | |||
| 45 | =head1 AUTHOR | ||
| 46 | |||
| 47 | Paul Evans <leonerd@leonerd.org.uk> | ||
| 48 | |||
| 49 | =cut | ||
| 50 | |||
| 51 | 2 | 0x55AA; | |