NAME

Myriad::Storage::Implementation::Memory - microservice storage abstraction

SYNOPSIS

DESCRIPTION

This is intended for use in tests and standalone local services. There is no persistence, and no shared data across multiple processes, but the full Myriad::Storage API should be exposed correctly.

get

Takes the following parameters:

  • $k - the relative key in storage

Returns a Future which will resolve to the corresponding value, or undef if none.

set

Takes the following parameters:

  • $k - the relative key in storage

  • $v - the scalar value to set

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.

getset

Takes the following parameters:

  • $k - the relative key in storage

  • $v - the scalar value to set

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.

incr

Takes the following parameters:

  • $k - the relative key in storage

Returns a Future which will resolve to the corresponding incremented value, or undef if none.

observe

Observe a specific key.

Returns a Ryu::Source which will emit the current and all subsequent values.

watch_keyspace

Returns update about keyspace

push

Takes the following parameters:

  • $k - the relative key in storage

  • $v - the scalar value to set

Returns a Future which will resolve to .

unshift

Takes the following parameters:

Returns a Future which will resolve to .

pop

Takes the following parameters:

Returns a Future which will resolve to .

shift

Takes the following parameters:

Returns a Future which will resolve to .

hash_set

Takes the following parameters:

Returns a Future which will resolve to .

hash_get

Takes the following parameters:

Returns a Future which will resolve to the scalar value for this key.

hash_add

Takes the following parameters:

Returns a Future indicating success or failure.

hash_keys

Takes the following parameters:

Returns a Future which will resolve to a list of the keys in no defined order.

hash_values

Takes the following parameters:

Returns a Future which will resolve to a list of the values in no defined order.

hash_exists

Takes the following parameters:

Returns a Future which will resolve to true if the key exists in this hash.

hash_count

Takes the following parameters:

Returns a Future which will resolve to the count of the keys in this hash.

hash_as_list

Takes the following parameters:

Returns a Future which will resolve to a list of key/value pairs, suitable for assigning to a hash.

orderedset_add

Takes the following parameters:

  • $k - the relative key in storage

  • $s - the scalar score value

  • $m - the scalar member value

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.

orderedset_remove_member

Takes the following parameters:

  • $k - the relative key in storage

  • $m - the scalar member value

Returns a Future which will resolve on completion.

orderedset_remove_byscore

Takes the following parameters:

  • $k - the relative key in storage

  • $min - the minimum score to remove

  • $max - the maximum score to remove

Returns a Future which will resolve on completion.

orderedset_member_count

Takes the following parameters:

  • $k - the relative key in storage

  • $min - minimum score for selection

  • $max - maximum score for selection

Returns a Future which will resolve on completion.

orderedset_members

Takes the following parameters:

  • $k - the relative key in storage

  • $min - minimum score for selection

  • $max - maximum score for selection

Returns a Future which will resolve on completion.

INHERITED METHODS

IO::Async::Notifier

add_child, adopt_future, adopted_futures, can_event, children, configure, configure_unknown, debug_printf, get_loop, invoke_error, invoke_event, loop, make_event_cb, maybe_invoke_event, maybe_make_event_cb, notifier_name, parent, remove_child, remove_from_parent

Object::Pad::UNIVERSAL

BUILDARGS

AUTHOR

Deriv Group Services Ltd. DERIV@cpan.org.

See "CONTRIBUTORS" in Myriad for full details.

LICENSE

Copyright Deriv Group Services Ltd 2020-2022. Licensed under the same terms as Perl itself.