summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorRobin Edwards <robin.ge@gmail.com>2012-07-04 06:41:18 -0700
committerRobin Edwards <robin.ge@gmail.com>2012-07-04 06:41:18 -0700
commit7afabed9e14ec3ea9de72c39fec56672ec63c5c1 (patch)
tree847855150cccc0c1e17c91ac8ea90845ce2b1910 /lib
parentMerge pull request #17 from dams/master (diff)
parentSupport for a timeout attribute in the PBC client (diff)
downloadnet-riak-7afabed9e14ec3ea9de72c39fec56672ec63c5c1.tar.gz
Merge pull request #18 from sukria/master
Support for timeout attribute in the PBC client
Diffstat (limited to 'lib')
-rw-r--r--lib/Net/Riak/Role/PBC.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Net/Riak/Role/PBC.pm b/lib/Net/Riak/Role/PBC.pm
index 605f032..bc32e3b 100644
--- a/lib/Net/Riak/Role/PBC.pm
+++ b/lib/Net/Riak/Role/PBC.pm
@@ -37,6 +37,12 @@ has socket => (
     predicate => 'has_socket',
 );
 
+has timeout => (
+    is => 'ro',
+    isa => Int,
+    default => 30,
+);
+
 sub is_alive {
     my $self = shift;
     return $self->send_message('PingReq');
@@ -56,7 +62,7 @@ sub connect {
             PeerAddr => $self->host,
             PeerPort => $self->port,
             Proto    => 'tcp',
-            Timeout  => 30,
+            Timeout  => $self->timeout,
         )
     );
 }