Subject: | Feature Requrest - Ability to set a timeout for the LWP::UserAgent |
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