Myriad::Role::Storage - microservice storage abstraction
my $storage = $myriad->storage; await $storage->get('some_key'); await $storage->hash_add('some_key', 'hash_key', 13);
Provides an abstraction over the Redis-based data model used by Myriad services.
For more information on the API design, please see the official Redis commands list. This model was used as the basis for the methods even when non-Redis backend storage systems are used.
Note that this is defined as a rôle, so it does not provide a concrete implementation - instead, see classes such as:
Myriad::Storage::Implementation::Redis
Myriad::Storage::Implementation::Memory
Takes the following parameters:
$k - the relative key in storage
$k
Returns a Future which will resolve to the corresponding value, or undef if none.
undef
$v - the scalar value to set
$v
Note that references are currently not supported - attempts to write an arrayref, hashref or object will fail.
Returns a Future which will resolve on completion.
Performs the same operation as "set", but additionally returns the original key value, if any.
Returns a Future which will resolve on completion to the original value, or undef if none.
Observe a specific key.
Returns a Ryu::Observable which will emit the current and all subsequent values.
Returns a Future.
Returns a Future which will resolve to the item removed from the list, or undef if none available.
Returns a Future which will resolve to .
Returns a Future which will resolve to the scalar value for this key.
Returns a Future indicating success or failure.
Returns a Future which will resolve to a list of the keys in no defined order.
Returns a Future which will resolve to a list of the values in no defined order.
Returns a Future which will resolve to true if the key exists in this hash.
Returns a Future which will resolve to the count of the keys in this hash.
Returns a Future which will resolve to a list of key/value pairs, suitable for assigning to a hash.
Deriv Group Services Ltd. DERIV@cpan.org.
DERIV@cpan.org
See "CONTRIBUTORS" in Myriad for full details.
Copyright Deriv Group Services Ltd 2020-2021. Licensed under the same terms as Perl itself.
To install Myriad, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Myriad
CPAN shell
perl -MCPAN -e shell install Myriad
For more information on module installation, please visit the detailed CPAN module installation guide.