NAME
LWP::Parallel::Protocol - Base class for parallel LWP protocols
SYNOPSIS
package LWP::Parallel::Protocol::foo;
require LWP::Parallel::Protocol;
@ISA=qw(LWP::Parallel::Protocol);
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.
Please see the LWP::Protocol for more information about the usage of this module.
In addition to the inherited methods from LWP::Protocol, The following methods and functions are provided:
ADDITIONAL METHODS AND FUNCTIONS
- $prot = new HTTP::Protocol;
-
The LWP::Protocol constructor is inherited by subclasses. As this is a virtual base class this method should not be called directly.
- $prot = LWP::Parallel::Protocol::create($url)
-
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.
- $class = LWP::Parallel::Protocol::implementor($scheme, [$class])
-
Get and/or set implementor class for a scheme. Returns '' if the specified scheme is not supported.
- $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 $arg is undefined, then the content is stored within the $response. If $arg is a simple scalar, then $arg is interpreted as a file name and the content is written to this file. If $arg is a reference to a routine, then content is passed to this routine.
$content must be a reference to a scalar holding the content that should be processed.
The return value from receive() is the $response object reference.
Note: We will only use the file or callback argument if $response->is_success(). This avoids sendig content data for redirects and authentization responses to the file or the callback function.
- $prot->receive_once($arg, $response, $content, $entry)
-
Can be called when the whole response content is available as $content. This will invoke receive() with a collector callback that returns a reference to $content the first time and an empty string the next.
SEE ALSO
Inspect the LWP/Parallel/Protocol/http.pm file for examples of usage.
COPYRIGHT
Copyright 1997,1998 Marc Langheinrich.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 262:
You forgot a '=back' before '=head1'