use BUILDARGS intead of wrapping new, added make_immutable, removed unnneeded test...
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / DBI / Replicated / Balancer / First.pm
CommitLineData
17b05c13 1package DBIx::Class::Storage::DBI::Replicated::Balancer::First;
2
17b05c13 3use Moose;
4with 'DBIx::Class::Storage::DBI::Replicated::Balancer';
5
6=head1 NAME
7
8DBIx::Class::Storage::DBI::Replicated::Balancer::First; Just get the First Balancer
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.
14
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
21This Balancer just get's whatever is the first replicant in the pool
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
43John Napiorkowski <john.napiorkowski@takkle.com>
44
45=head1 LICENSE
46
47You may distribute this code under the same terms as Perl itself.
48
49=cut
50
c354902c 51__PACKAGE__->meta->make_immutable;
52
17b05c13 531;