summaryrefslogtreecommitdiff
path: root/lib/Net/Riak/Client.pm
diff options
context:
space:
mode:
authorRobin Edwards <robin.ge@gmail.com>2011-04-20 14:38:43 +0100
committerRobin Edwards <robin.ge@gmail.com>2011-04-20 14:38:43 +0100
commit79bea382fd2c0753ca9ace79a11bb74c9a1d722b (patch)
treebde42a47792a27e0a863ee527b88c8c24258f7e9 /lib/Net/Riak/Client.pm
parentMerge remote branch 'simon/fix_link_encoding' (diff)
downloadnet-riak-79bea382fd2c0753ca9ace79a11bb74c9a1d722b.tar.gz
merged pbc branch to master
Diffstat (limited to '')
-rw-r--r--lib/Net/Riak/Client.pm34
1 files changed, 1 insertions, 33 deletions
diff --git a/lib/Net/Riak/Client.pm b/lib/Net/Riak/Client.pm
index 4d14338..f38bec6 100644
--- a/lib/Net/Riak/Client.pm
+++ b/lib/Net/Riak/Client.pm
@@ -2,10 +2,8 @@ package Net::Riak::Client;
use Moose;
use MIME::Base64;
-use Moose::Util::TypeConstraints;
-class_type 'HTTP::Request';
-class_type 'HTTP::Response';
+with 'MooseX::Traits';
has prefix => (
is => 'rw',
@@ -27,40 +25,10 @@ has client_id => (
isa => 'Str',
lazy_build => 1,
);
-has http_request => (
- is => 'rw',
- isa => 'HTTP::Request',
-);
-
-has http_response => (
- is => 'rw',
- isa => 'HTTP::Response',
- handles => ['is_success']
-);
-
-has ua_timeout => (
- is => 'rw',
- isa => 'Int',
- default => 3
-);
-
-with 'Net::Riak::Role::UserAgent';
-with qw/
- Net::Riak::Role::REST
- Net::Riak::Role::Hosts
- /;
-
-
sub _build_client_id {
"perl_net_riak" . encode_base64(int(rand(10737411824)), '');
}
-sub is_alive {
- my $self = shift;
- my $request = $self->new_request('GET', ['ping']);
- my $response = $self->send_request($request);
- $self->is_success ? return 1 : return 0;
-}
1;