sergot / http-useragent

Web user agent class for Perl 6.
MIT License
36 stars 39 forks source link

HTTP::UserAgent.new(timeout => 10) does not set the timeout but probably should #206

Open AlexDaniel opened 6 years ago

AlexDaniel commented 6 years ago

I was expecting this code to work:

my $ua = HTTP::UserAgent.new(timeout => 10);
say $ua # HTTP::UserAgent.new(timeout => 180, …)

But it doesn't, and it seems like I have to set the timeout with $ua.timeout = 10. Would've been great if it was possible to set the timeout right from the constructor.

ugexe commented 6 years ago

https://github.com/sergot/http-useragent/blob/06a70d5cc8905dd5c5e16f26c8ca8cc1ad85f369/lib/HTTP/UserAgent.pm6#L75

s/submethod BUILD/submethod TWEAK/