connect() is missing the prepare callback, similarly to what AnyEvent::Socket::tcp_connect provides.
I suggest:
@@ -70,7 +70,7 @@ has max_payload_size => (
sub connect
{
- my($self, $uri) = @_;
+ my($self, $uri, $preparecb) = @_;
unless(ref $uri)
{
require URI;
@@ -167,7 +167,10 @@ sub connect
undef $done;
}
});
- }, sub { $self->timeout };
+ }, sub {
+ my $timeout = $preparecb->(@_) if defined $preparecb;
+ return $timeout || $self->timeout;
+ };
$done;
}
connect() is missing the prepare callback, similarly to what AnyEvent::Socket::tcp_connect provides.
I suggest: