diff --git a/lib/AnyEvent/NSQ/Connection.pm b/lib/AnyEvent/NSQ/Connection.pm index 536552b..e9e2a0e 100644 --- a/lib/AnyEvent/NSQ/Connection.pm +++ b/lib/AnyEvent/NSQ/Connection.pm @@ -42,7 +42,7 @@ sub new { $self->{host} = delete $args{host} or croak q{FATAL: required 'host' parameter is missing}; $self->{port} = delete $args{port} or croak q{FATAL: required 'port' parameter is missing}; - for my $p (qw( client_id hostname connect_cb error_cb )) { + for my $p (qw( client_id hostname connect_cb error_cb connect_timeout )) { $self->{$p} = delete $args{$p} if exists $args{$p} and defined $args{$p}; } diff --git a/lib/AnyEvent/NSQ/Reader.pm b/lib/AnyEvent/NSQ/Reader.pm index 67b6635..fc49115 100644 --- a/lib/AnyEvent/NSQ/Reader.pm +++ b/lib/AnyEvent/NSQ/Reader.pm @@ -22,7 +22,7 @@ sub new { $self->{disconnect_cb} = delete($args{disconnect_cb}) || sub { }; $self->{error_cb} = delete($args{error_cb}) || sub { croak($_[1]) }; - for my $arg (qw( ready_count client_id hostname requeue_delay )) { + for my $arg (qw( ready_count client_id hostname requeue_delay connect_timeout )) { $self->{$arg} = delete($args{$arg}) if exists $args{$arg}; } @@ -79,7 +79,7 @@ sub _start_nsqd_connection { croak(qq{FATAL: could not parse '$nsqd_tcp_address' as a valid address/port combination}) unless $host and $port; my %conn = (host => $host, port => $port); - for my $arg (qw( client_id hostname error_cb requeue_delay )) { + for my $arg (qw( client_id hostname error_cb requeue_delay connect_timeout )) { $conn{$arg} = $self->{$arg} if exists $self->{$arg}; }