NAME

ShardedKV::Storage - Role for classes implementing storage backends

VERSION

version 0.17

SYNOPSIS

package ShardedKV::Storage::MyBackend;
use Moose;
with 'ShardedKV::Storage';

sub get { ... }
sub set { ... }
sub delete { ... }
sub reset_connection { ... }
1;

DESCRIPTION

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.

ROLE REQUIRES

get

get() needs to accept a key of some sort and return whatever is relevant.

set

set() needs to accept both a key, and a reference to a datastructure suitable for storing

delete

delete() needs to accept a key and it must remove the data stored under that key

reset_connection

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.

SEE ALSO

AUTHORS

  • Steffen Mueller <smueller@cpan.org>

  • Nick Perez <nperez@cpan.org>

COPYRIGHT AND LICENSE

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.