Skip Menu | You are currently an anonymous guest. | Login | Return to Main | About rt.cpan.org
 

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.

X Report information
Id: 28167
Status: resolved
Left: 0 min
Priority: 0/0
Queue: XML-TreePP

Owner: Nobody
Requestors: NEELY <neil [...] neely.cx>
Cc:
AdminCc:

Severity: Wishlist
Broken in: 0.19
Fixed in: (no value)



X History Display mode: Brief headersFull headers
#   Fri Jul 13 17:35:29 2007 NEELY - Ticket created  
Subject: Feature Requrest - Ability to set a timeout for the LWP::UserAgent
[text/plain 1k]
I've been using the XML::RPC module which is derived off of your XML::TreePP module, and
the combination is wonderfully useful for me.

While deploying a number of XML::RPC tools I encountered a limitation of this setup however
in that your module has a hard coded timeout of 10 seconds set to the LWP::Useragent call.
This is a very sensible timeout for most applications, but some legacy tools are extremely
slow and I need the ability to allow them more time to run.

Looking over your code, I believe this will be trivial to add in, just modify:
my $ua = LWP::UserAgent->new();
$ua->timeout(10);
$ua->env_proxy();

to be:
my $ua = LWP::UserAgent->new();
$ua->timeout($self->{timeout});
$ua->env_proxy();

And modify your constructor to be:

sub new {
my $package = shift;
my $self = {@_};
$self->{timeout} = 10 unless defined $self->{timeout};
bless $self, $package;
$self;
}

Because XML::RPC passes it's arguments onto your constructor it should automatically pick
this feature up.

Thank you for your time,

Neil Neely
neil[...]neely.cx
#   Sun Jul 22 07:15:56 2007 KAWASAKI - Correspondence added  
RT-Send-CC: xml-treepp[...]yahoogroups.com
[text/plain 1.8k]
I've just released version 0.20 of the module which
supports "lwp_useragent" option in stead of "timeout".

Your request:
my $tpp = XML::TreePP->new( timeout => 10 );

XML::TreePP Version 0.20 now allows:
my $ua = LWP::UserAgent->new( timeout => 10 );
my $tpp = XML::TreePP->new( lwp_useragent => $ua );

See:
http://www.kawa.net/works/perl/treepp/treepp-e.html

----
Kawasaki Yusuke

> Fri Jul 13 17:35:29 2007: Request 28167 was acted upon.
> Transaction: Ticket created by NEELY
> Queue: XML-TreePP
> Subject: Feature Requrest - Ability to set a timeout for the
LWP::UserAgent
> Broken in: 0.19
> Severity: Wishlist
> Owner: Nobody
> Requestors: neil[...]neely.cx
> Status: new
> Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=28167 >
>
>
> I've been using the XML::RPC module which is derived off of your
XML::TreePP module, and
> the combination is wonderfully useful for me.
>
> While deploying a number of XML::RPC tools I encountered a limitation
of this setup however
> in that your module has a hard coded timeout of 10 seconds set to the
LWP::Useragent call.
> This is a very sensible timeout for most applications, but some legacy
tools are extremely
> slow and I need the ability to allow them more time to run.
>
> Looking over your code, I believe this will be trivial to add in, just
modify:
> my $ua = LWP::UserAgent->new();
> $ua->timeout(10);
> $ua->env_proxy();
>
> to be:
> my $ua = LWP::UserAgent->new();
> $ua->timeout($self->{timeout});
> $ua->env_proxy();
>
> And modify your constructor to be:
>
> sub new {
> my $package = shift;
> my $self = {@_};
> $self->{timeout} = 10 unless defined $self->{timeout};
> bless $self, $package;
> $self;
> }
>
> Because XML::RPC passes it's arguments onto your constructor it should
automatically pick
> this feature up.
>
> Thank you for your time,
>
> Neil Neely
> neil[...]neely.cx
#   Sun Jul 22 07:16:08 2007 RT_System - Status changed from 'new' to 'open'  
#   Sun Jul 22 07:16:15 2007 KAWASAKI - Status changed from 'open' to 'resolved'