package Message::Passing::Redis::Role::HasAConnection;
use Moose::Role;
use Message::Passing::Redis::ConnectionManager;
use namespace::autoclean;

with qw/
    Message::Passing::Role::HasAConnection
    Message::Passing::Role::HasHostnameAndPort
/;

sub _default_port { 6379 }

sub _build_connection_manager {
    my $self = shift;
    Message::Passing::Redis::ConnectionManager->new(map { $_ => $self->$_() }
        qw/ hostname port /
    );
}

1;

