.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "LWP::Parallel::Protocol 3"
.TH LWP::Parallel::Protocol 3 "2016-05-29" "perl v5.26.3" "User Contributed Perl Documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
LWP::Parallel::Protocol \- Base class for parallel LWP protocols
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 3
\& package LWP::Parallel::Protocol::foo;
\& require LWP::Parallel::Protocol;
\& @ISA=qw(LWP::Parallel::Protocol);
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
This class is used a the base class for all protocol implementations
supported by the LWP::Parallel library. It mirrors the behavior of the
original LWP::Parallel library by subclassing from it and adding a few
subroutines of its own.
.PP
Please see the LWP::Protocol for more information about the usage of
this module.
.PP
In addition to the inherited methods from LWP::Protocol, The following
methods and functions are provided:
.SH "ADDITIONAL METHODS AND FUNCTIONS"
.IX Header "ADDITIONAL METHODS AND FUNCTIONS"
.ie n .IP "$prot = LWP::Parallel::Protocol\->\fBnew()\fR;" 4
.el .IP "\f(CW$prot\fR = LWP::Parallel::Protocol\->\fBnew()\fR;" 4
.IX Item "$prot = LWP::Parallel::Protocol->new();"
The LWP::Parallel::Protocol constructor is inherited by subclasses. As this is
a virtual base class this method should \fBnot\fR be called directly.
.Sp
Note: This is inherited from LWP::Protocol
.ie n .IP "$prot = LWP::Parallel::Protocol::create($schema)" 4
.el .IP "\f(CW$prot\fR = LWP::Parallel::Protocol::create($schema)" 4
.IX Item "$prot = LWP::Parallel::Protocol::create($schema)"
Create an object of the class implementing the protocol to handle the
given scheme. This is a function, not a method. It is more an object
factory than a constructor. This is the function user agents should
use to access protocols.
.ie n .IP "$class = LWP::Parallel::Protocol::implementor($scheme, [$class])" 4
.el .IP "\f(CW$class\fR = LWP::Parallel::Protocol::implementor($scheme, [$class])" 4
.IX Item "$class = LWP::Parallel::Protocol::implementor($scheme, [$class])"
Get and/or set implementor class for a scheme. Returns '' if the
specified scheme is not supported.
.ie n .IP "$prot\->receive ($arg, $response, $content)" 4
.el .IP "\f(CW$prot\fR\->receive ($arg, \f(CW$response\fR, \f(CW$content\fR)" 4
.IX Item "$prot->receive ($arg, $response, $content)"
Called to store a piece of content of a request, and process it
appropriately into a scalar, file, or by calling a callback. If \f(CW$arg\fR
is undefined, then the content is stored within the \f(CW$response\fR. If
\&\f(CW$arg\fR is a simple scalar, then \f(CW$arg\fR is interpreted as a file name and
the content is written to this file. If \f(CW$arg\fR is a reference to a
routine, then content is passed to this routine.
.Sp
\&\f(CW$content\fR must be a reference to a scalar holding the content that
should be processed.
.Sp
The return value from \fBreceive()\fR is undef for errors, positive for
non-zero content processed, 0 for forced EOFs, and potentially a
negative command from a user-defined callback function.
.Sp
\&\fBNote:\fR We will only use the file or callback argument if
\&\f(CW$response\fR\->\fBis_success()\fR. This avoids sendig content data for
redirects and authentization responses to the file or the callback
function.
.ie n .IP "$prot\->receive_once($arg, $response, $content, $entry)" 4
.el .IP "\f(CW$prot\fR\->receive_once($arg, \f(CW$response\fR, \f(CW$content\fR, \f(CW$entry\fR)" 4
.IX Item "$prot->receive_once($arg, $response, $content, $entry)"
Can be called when the whole response content is available as
\&\f(CW$content\fR. This will invoke \fBreceive()\fR with a collector callback that
returns a reference to \f(CW$content\fR the first time and an empty string the
next.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
Inspect the \fILWP/Parallel/Protocol/http.pm\fR file for examples of usage.
.SH "COPYRIGHT"
.IX Header "COPYRIGHT"
Copyright 1997\-2004 Marc Langheinrich <marclang@cpan.org>
Parts copyright 1995\-2004 Gisle Aas
.PP
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
.SH "POD ERRORS"
.IX Header "POD ERRORS"
Hey! \fBThe above document had some coding errors, which are explained below:\fR
.IP "Around line 291:" 4
.IX Item "Around line 291:"
You forgot a '=back' before '=head1'