The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Zing::Dropbox - Transient Store

ABSTRACT

Transient Key/Value Store

SYNOPSIS

  use Zing::Dropbox;

  my $dropbox = Zing::Dropbox->new;

DESCRIPTION

This package provides a general-purpose key/value store for transient data.

INHERITS

This package inherits behaviors from:

Zing::KeyVal

LIBRARIES

This package uses type constraints from:

Zing::Types

METHODS

This package implements the following methods:

poll

  poll(Str $name, Int $secs) : Maybe[HashRef]

The poll method watches (i.e. polls) the key specified for n seconds and either a) returns the data once it's received and drops the key, or b) returns undefined.

poll example #1
  # given: synopsis

  $dropbox->poll(ephemeral => 0);
poll example #2
  # given: synopsis

  # some other process places the data
  $dropbox->send(ephemeral => { data => '...' });

  # poll "ephemeral" for 10 secs, except the data was already placed
  $dropbox->poll(ephemeral => 10);
poll example #3
  # given: synopsis

  # poll "ephemeral" for 10 secs
  $dropbox->poll(ephemeral => 10);

  # some other process places the data
  $dropbox->send(ephemeral => { data => '...' });

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