A couple of typos, and general whitespace cleanup (ick)
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / DBI / Replicated / Replicant.pm
CommitLineData
26ab719a 1package DBIx::Class::Storage::DBI::Replicated::Replicant;
2
de5dc9ef 3use Moose::Role;
edbf2778 4requires qw/_query_start/;
ee356d00 5with 'DBIx::Class::Storage::DBI::Replicated::WithDSN';
6use MooseX::Types::Moose 'Bool';
41916570 7
8use namespace::clean -except => 'meta';
26ab719a 9
10=head1 NAME
11
21fc4719 12DBIx::Class::Storage::DBI::Replicated::Replicant - A replicated DBI Storage Role
26ab719a 13
14=head1 SYNOPSIS
15
de5dc9ef 16This class is used internally by L<DBIx::Class::Storage::DBI::Replicated>.
d4daee7b 17
26ab719a 18=head1 DESCRIPTION
19
20Replicants are DBI Storages that follow a master DBI Storage. Typically this
21is accomplished via an external replication system. Please see the documents
22for L<DBIx::Class::Storage::DBI::Replicated> for more details.
23
24This class exists to define methods of a DBI Storage that only make sense when
25it's a classic 'slave' in a pool of slave databases which replicate from a
26given master database.
27
28=head1 ATTRIBUTES
29
30This class defines the following attributes.
31
50336325 32=head2 active
33
34This is a boolean which allows you to programmatically activate or deactivate a
35replicant from the pool. This way to you do stuff like disallow a replicant
36when it get's too far behind the master, if it stops replicating, etc.
37
9c748388 38This attribute DOES NOT reflect a replicant's internal status, i.e. if it is
39properly replicating from a master and has not fallen too many seconds behind a
40reliability threshold. For that, use L</is_replicating> and L</lag_behind_master>.
41Since the implementation of those functions database specific (and not all DBIC
42supported DB's support replication) you should refer your database specific
43storage driver for more information.
44
50336325 45=cut
46
47has 'active' => (
64cdad22 48 is=>'rw',
41916570 49 isa=>Bool,
64cdad22 50 lazy=>1,
51 required=>1,
52 default=>1,
50336325 53);
54
26ab719a 55=head1 METHODS
56
57This class defines the following methods.
58
edbf2778 59=head2 debugobj
60
61Override the debugobj method to redirect this method call back to the master.
62
63=cut
64
65sub debugobj {
66 return shift->schema->storage->debugobj;
67}
68
e515254d 69=head1 ALSO SEE
70
ee356d00 71L<http://en.wikipedia.org/wiki/Replicant>,
72L<DBIx::Class::Storage::DBI::Replicated>
e515254d 73
26ab719a 74=head1 AUTHOR
75
76John Napiorkowski <john.napiorkowski@takkle.com>
77
78=head1 LICENSE
79
80You may distribute this code under the same terms as Perl itself.
81
50336325 82=cut
83
41916570 841;