Data::Model::Driver::Cache::Memcached - Penetration cache is offered to the basic driver by memcached protocol


Data-Model documentation  | view source Contained in the Data-Model distribution.

Index


NAME

Top

Data::Model::Driver::Cache::Memcached - Penetration cache is offered to the basic driver by memcached protocol

SYNOPSIS

Top

  package MyDB;
  use base 'Data::Model';
  use Data::Model::Schema;
  use Data::Model::Driver::DBI;
  use Data::Model::Driver::Cache::Memcached;

  my $dbi_connect_options = {};
  my $fallback_driver = Data::Model::Driver::DBI->new(
      dsn             => 'dbi:mysql:host=localhost:database=test',
      username        => 'user',
      password        => 'password',
      connect_options => $dbi_connect_options,
  );

  my $driver = Data::Model::Driver::Cache::Memcached->new(
      fallback  => $fallback_driver,
      memcached => Cache::Memcached::Fast->new({ servers => [ { address => "localhost:11211" }, ], }),
  );

  base_driver $driver;
  install_model model_name => schema {
    ....
  };

DESCRIPTION

Top

Penetration cache is offered to the basic driver. Cash is stored in the memcached protocol server.

When cash does not hit, it asks fallback driver.

SEE ALSO

Top

Cache::Memcached::Fast, Data::Model

AUTHOR

Top

Kazuhiro Osawa <yappo <at> shibuya <döt> pl>

LICENSE

Top

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


Data-Model documentation  | view source Contained in the Data-Model distribution.