#!/usr/bin/env perl

use strict;
use warnings;

use lib 'definitions';

use Zing::KeyVal;

=pod explain

- zing-keyval is a generic key/val data store
- it a subclass of Zing/Repo and uses Zing/Store operations

=cut

my $k = Zing::KeyVal->new(name => 'states');

for my $i (1..1_000) {
  warn "state-$i", " ", Zing::KeyVal->new(name => "state-$i")->send({created => time});
}

for my $i (1..1_000) {
  warn "state-$i", " ", "created", " ", Zing::KeyVal->new(name => "state-$i")->recv("state-$i")->{created};
}

for my $i (1..1_000) {
  warn "state-$i", " ", "dropped", " ", Zing::KeyVal->new(name => "state-$i")->drop;
}

warn 'key/val data sent and received';