The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

dtRdr::UserAgent - Custom LWP::Iterator::UserAgent

SYNOPSIS

new

  my $ua = dtRdr::UserAgent->new;

add_request

This registers a request and returns a token for accessing the returned data from it later. The $method, $url, (and optional headers, content) arguments get passed to HTTP::Request.

  my $token = $ua->add_request($method, $url, [%headers], $content);

Or, options in a leading hash reference.

  $ua->add_request({token => $token}, $method, $url);

register

Override base class to deal with request-time tracking.

  $self->register(@_);

is_started

  $ua->is_started($token);

is_complete

  $ua->is_complete($token);

collect

Take possession of the data collected for $token (can only be called once.)

  my %data = $ua->collect($token);

This is the point where asynchronous processing joins back to the main flow, so it will die if exceptions were thrown during the connection.

leftovers

  my %also = $ua->leftovers;

Internals

_collect

  $ua->_collect;

compute_time_shift

Calculates server time shift.

  $self->compute_time_shift($token, $response);

on_connect

  $ua->on_connect;

on_failure

  $ua->on_failure;

on_return

  $ua->on_return;

_complete_request

Delete the token and destroy the subref, then hit the callback.

  $self->_complete_request($subref);

get_basic_credentials

Called by base class upon authentication request. Triggers the auth_sub callback.

  $self->get_basic_credentials($realm, $uri);

  $callback->($realm, $uri);

AUTHOR

Eric Wilhelm <ewilhelm at cpan dot org>

http://scratchcomputing.com/

COPYRIGHT

Copyright (C) 2006-2007 Eric L. Wilhelm and Osoft, All Rights Reserved.

NO WARRANTY

Absolutely, positively NO WARRANTY, neither express or implied, is offered with this software. You use this software at your own risk. In case of loss, no person or entity owes you anything whatsoever. You have been warned.

LICENSE

The dotReader(TM) is OSI Certified Open Source Software licensed under the GNU General Public License (GPL) Version 2, June 1991. Non-encrypted and encrypted packages are usable in connection with the dotReader(TM). The ability to create, edit, or otherwise modify content of such encrypted packages is self-contained within the packages, and NOT provided by the dotReader(TM), and is addressed in a separate commercial license.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.