convert from the bottom up
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / DBI / Replicated / Balancer / First.pm
CommitLineData
17b05c13 1package DBIx::Class::Storage::DBI::Replicated::Balancer::First;
2
0bbe6676 3use Moo;
17b05c13 4with 'DBIx::Class::Storage::DBI::Replicated::Balancer';
5
6=head1 NAME
7
21fc4719 8DBIx::Class::Storage::DBI::Replicated::Balancer::First - Just get the First Balancer
17b05c13 9
10=head1 SYNOPSIS
11
12This class is used internally by L<DBIx::Class::Storage::DBI::Replicated>. You
13shouldn't need to create instances of this class.
d4daee7b 14
17b05c13 15=head1 DESCRIPTION
16
17Given a pool (L<DBIx::Class::Storage::DBI::Replicated::Pool>) of replicated
18database's (L<DBIx::Class::Storage::DBI::Replicated::Replicant>), defines a
19method by which query load can be spread out across each replicant in the pool.
20
48580715 21This Balancer just gets whichever is the first replicant in the pool.
17b05c13 22
23=head1 ATTRIBUTES
24
25This class defines the following attributes.
26
27=head1 METHODS
28
29This class defines the following methods.
30
31=head2 next_storage
32
33Just get the first storage. Probably only good when you have one replicant.
34
35=cut
36
37sub next_storage {
64cdad22 38 return (shift->pool->active_replicants)[0];
17b05c13 39}
40
41=head1 AUTHOR
42
0bbe6676 43John Napiorkowski <jjnapiork@cpan.org>
17b05c13 44
45=head1 LICENSE
46
47You may distribute this code under the same terms as Perl itself.
48
49=cut
50
41916570 511;