replicant from the pool. This way to you do stuff like disallow a replicant
when it get's too far behind the master, if it stops replicating, etc.
+This attribute DOES NOT reflect a replicant's internal status, i.e. if it is
+properly replicating from a master and has not fallen too many seconds behind a
+reliability threshold. For that, use L</is_replicating> and L</lag_behind_master>.
+Since the implementation of those functions database specific (and not all DBIC
+supported DB's support replication) you should refer your database specific
+storage driver for more information.
+
=cut
has 'active' => (
default=>1,
);
-
=head1 METHODS
This class defines the following methods.
$self->$method("DSN: $dsn SQL: $sql", @bind);
};
+=head2 is_replicating
+
+A boolean that reports if a particular L<DBIx::Class::Storage::DBI> is set to
+replicate from a master database. Default is false, which is the result
+returned by databases that don't support replication.
+
+=cut
+
+sub is_replicating {
+ my $self = shift @_;
+}
+
+=head2 lag_behind_master
+
+Returns a number that represents a certain amount of lag behind a master db
+when a given storage is replicating. The number is database dependent, but
+starts at zero, which is the default, and increases with the amount of lag.
+
+=cut
+
+sub lag_behind_master {
+ my $self = shift @_;
+}
=head1 AUTHOR
$replicated->schema->storage->set_balanced_storage;
ok $replicated->schema->resultset('Artist')->find(3)
- => 'Read from replicant';
+ => 'Read from replicant';
}
-## Make sure when $reliable goes out of scope, we are using replicants again
+## Make sure when reliable goes out of scope, we are using replicants again
ok $replicated->schema->resultset('Artist')->find(1)
=> 'back to replicant 1.';