ShardedKV::Storage - Role for classes implementing storage backends
version 0.20
package ShardedKV::Storage::MyBackend; use Moose; with 'ShardedKV::Storage'; sub get { ... } sub set { ... } sub delete { ... } sub reset_connection { ... } 1;
ShardedKV::Storage provides a role/interface that storage backends must consume. Consuming the role requires implementing the three important operations necessary for a storage backend. There are a few storage backends that come with ShardedKV. Please see those modules for their specific details.
get() needs to accept a key of some sort and return whatever is relevant.
set() needs to accept both a key, and a reference to a datastructure suitable for storing
delete() needs to accept a key and it must remove the data stored under that key
Storage backends must implement reset_connection() to allow for reconnects. Since most things are not reentrant and signals can mess with the state of sockets and such, the ability to reset the connection (whatever that means for your particular storage backend), is paramount.
ShardedKV
ShardedKV::Storage::Memory
ShardedKV::Storage::Redis
ShardedKV::Storage::MySQL
Steffen Mueller <smueller@cpan.org>
Nick Perez <nperez@cpan.org>
Damian Gryski <dgryski@cpan.org>
This software is copyright (c) 2013 by Steffen Mueller.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install ShardedKV, copy and paste the appropriate command in to your terminal.
cpanm
cpanm ShardedKV
CPAN shell
perl -MCPAN -e shell install ShardedKV
For more information on module installation, please visit the detailed CPAN module installation guide.