The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Zing::KeyVal - Key/Value Store

ABSTRACT

Generic Key/Value Store

SYNOPSIS

  use Zing::KeyVal;

  my $keyval = Zing::KeyVal->new(name => 'notes');

  # $keyval->recv('today');

DESCRIPTION

This package provides a general-purpose key/value store abstraction.

INHERITS

This package inherits behaviors from:

Zing::Repo

LIBRARIES

This package uses type constraints from:

Zing::Types

ATTRIBUTES

This package has the following attributes:

name

  name(Str)

This attribute is read-only, accepts (Str) values, and is optional.

METHODS

This package implements the following methods:

poll

  poll(Str $key) : Poll

The poll method returns a Zing::Poll object which can be used to perform a blocking-fetch from the store.

poll example #1
  # given: synopsis

  $keyval->poll('today');

recv

  recv(Str $key) : Maybe[HashRef]

The recv method fetches the data (if any) from the store.

recv example #1
  # given: synopsis

  $keyval->recv('today');
recv example #2
  # given: synopsis

  $keyval->send('today', { status => 'happy' });

  $keyval->recv('today');

send

  send(Str $key, HashRef $value) : Str

The send method commits data to the store overwriting any existing data.

send example #1
  # given: synopsis

  $keyval->send('today', { status => 'happy' });
send example #2
  # given: synopsis

  $keyval->drop;

  $keyval->send('today', { status => 'happy' });

term

  term(Str @keys) : Str

The term method generates a term (safe string) for the datastore.

term example #1
  # given: synopsis

  $keyval->term('today');

AUTHOR

Al Newkirk, awncorp@cpan.org

LICENSE

Copyright (C) 2011-2019, Al Newkirk, et al.

This is free software; you can redistribute it and/or modify it under the terms of the The Apache License, Version 2.0, as elucidated in the "license file".

PROJECT

Wiki

Project

Initiatives

Milestones

Contributing

Issues