DBIx::Class::Storage::DBI::Replicated::Balancer::First - Just get the First Balancer


DBIx-Class documentation Contained in the DBIx-Class distribution.

Index


Code Index:

NAME

Top

DBIx::Class::Storage::DBI::Replicated::Balancer::First - Just get the First Balancer

SYNOPSIS

Top

This class is used internally by DBIx::Class::Storage::DBI::Replicated. You shouldn't need to create instances of this class.

DESCRIPTION

Top

Given a pool (DBIx::Class::Storage::DBI::Replicated::Pool) of replicated database's (DBIx::Class::Storage::DBI::Replicated::Replicant), defines a method by which query load can be spread out across each replicant in the pool.

This Balancer just gets whichever is the first replicant in the pool.

ATTRIBUTES

Top

This class defines the following attributes.

METHODS

Top

This class defines the following methods.

next_storage

Just get the first storage. Probably only good when you have one replicant.

AUTHOR

Top

John Napiorkowski <john.napiorkowski@takkle.com>

LICENSE

Top

You may distribute this code under the same terms as Perl itself.


DBIx-Class documentation Contained in the DBIx-Class distribution.
package DBIx::Class::Storage::DBI::Replicated::Balancer::First;

use Moose;
with 'DBIx::Class::Storage::DBI::Replicated::Balancer';
use namespace::clean -except => 'meta';

sub next_storage {
  return  (shift->pool->active_replicants)[0];
}

__PACKAGE__->meta->make_immutable;

1;