summaryrefslogtreecommitdiff
path: root/lib/Travel/Status/DE
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2015-04-30 13:37:22 +0200
committerDaniel Friesel <derf@finalrewind.org>2015-04-30 13:37:22 +0200
commit702002d7d9dae38e7ae375dafefa20ae0f865a16 (patch)
tree93a6dbbd5ec11cb1f2b86a1cb887a9867d202d42 /lib/Travel/Status/DE
parente2ece5a9c331ad62fb93cffb633315b5268f8851 (diff)
EFA, efa-m: Add timeout parameter
Diffstat (limited to 'lib/Travel/Status/DE')
-rw-r--r--lib/Travel/Status/DE/EFA.pm10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Travel/Status/DE/EFA.pm b/lib/Travel/Status/DE/EFA.pm
index f8ea9f7..248f017 100644
--- a/lib/Travel/Status/DE/EFA.pm
+++ b/lib/Travel/Status/DE/EFA.pm
@@ -18,6 +18,11 @@ use XML::LibXML;
sub new {
my ( $class, %opt ) = @_;
+ $opt{timeout} //= 10;
+ if ( $opt{timeout} <= 0 ) {
+ delete $opt{timeout};
+ }
+
my $ua = LWP::UserAgent->new(%opt);
my @now = localtime( time() );
@@ -473,6 +478,11 @@ B<stop> (stop/station name).
address / poi / stop name to list departures for.
+=item B<timeout> => I<seconds>
+
+Request timeout, the argument is passed on to LWP::UserAgent(3pm).
+Default: 10 seconds. Set to 0 or a negative value to disable it.
+
=back
=item $status->errstr