Skip to content

Commit

Permalink
oo: passthru all meaningful request params
Browse files Browse the repository at this point in the history
Add these besides 'head':

- socket_cache
- on_connect
- connect_timeout
- read_timeout
  • Loading branch information
gugod committed Jul 1, 2016
1 parent 7b8a419 commit 01a9e59
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/Elastijk/oo.pm
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,20 @@ sub new {
*Elastijk::new = sub { shift; Elastijk::oo->new(@_) };
};

sub __fleshen_request_args {
my ($self, $args) = @_;
$args->{$_} ||= $self->{$_} for grep { exists $self->{$_} } qw(host port index type head socket_cache on_connect connect_timeout read_timeout);
}

sub request {
my ($self, %args) = @_;
$args{$_} ||= $self->{$_} for grep { exists $self->{$_} } qw(host port index type head);
__fleshen_request_args($self, \%args);
return Elastijk::request(\%args);
}

sub request_raw {
my ($self, %args) = @_;
$args{$_} ||= $self->{$_} for grep { exists $self->{$_} } qw(host port index type head);
__fleshen_request_args($self, \%args);
return Elastijk::request_raw(\%args);
}

Expand Down

0 comments on commit 01a9e59

Please sign in to comment.