package DBIx::Class::Storage::DBI::Replicated::Balancer;
-use Moose::Role;
+use Moo::Role;
requires 'next_storage';
-use MooseX::Types::Moose qw/Int/;
+use Types::Standard qw/Int/;
+use Type::Utils qw/class_type/;
+use Scalar::Util qw/blessed/;
use DBIx::Class::Storage::DBI::Replicated::Pool;
use DBIx::Class::Storage::DBI::Replicated::Types qw/DBICStorageDBI/;
-use namespace::clean -except => 'meta';
+use namespace::clean;
=head1 NAME
has 'pool' => (
is=>'ro',
- isa=>'DBIx::Class::Storage::DBI::Replicated::Pool',
+ isa=>class_type('DBIx::Class::Storage::DBI::Replicated::Pool'),
required=>1,
);
has 'current_replicant' => (
is=> 'rw',
isa=>DBICStorageDBI,
- lazy_build=>1,
+ lazy=>1,
+ builder=>1,
+ predicate=>1,
+ clearer=>1,
handles=>[qw/
select
select_single
=head2 _build_current_replicant
-Lazy builder for the L</current_replicant_storage> attribute.
+Lazy builder for the L</current_replicant> attribute.
=cut
that it's easier to break out the auto validation into a role.
This also returns the master in the case that none of the replicants are active
-or just just forgot to create them :)
+or just forgot to create them :)
=cut
}
}
-=head1 AUTHOR
+=head1 FURTHER QUESTIONS?
-John Napiorkowski <jjnapiork@cpan.org>
+Check the list of L<additional DBIC resources|DBIx::Class/GETTING HELP/SUPPORT>.
-=head1 LICENSE
+=head1 COPYRIGHT AND LICENSE
-You may distribute this code under the same terms as Perl itself.
+This module is free software L<copyright|DBIx::Class/COPYRIGHT AND LICENSE>
+by the L<DBIx::Class (DBIC) authors|DBIx::Class/AUTHORS>. You can
+redistribute it and/or modify it under the same terms as the
+L<DBIx::Class library|DBIx::Class/COPYRIGHT AND LICENSE>.
=cut