++ed by:

1 non-PAUSE user(s).

Stephen Adkins

NAME

App::SharedDatastore - Interface for sharing data between processes

SYNOPSIS

    use App;

    $context = App->context();
    $sds = $context->service("SharedDatastore");
    $sds = $context->shared_datastore();

DESCRIPTION

A SharedDatastore service represents a single hash in which scalars or deep references may be stored (basically an MLDBM).

Class Group: SharedDatastore

The following classes might be a part of the SharedDatastore Class Group.

  • Class: App::SharedDatastore

  • Class: App::SharedDatastore::Repository

  • Class: App::SharedDatastore::IPCMM

  • Class: App::SharedDatastore::DBI

  • Class: App::SharedDatastore::MLDBM

  • Class: App::SharedDatastore::ApacheSession

  • Class: App::SharedDatastore::IPCShareLite

  • Class: App::SharedDatastore::IPCShareable

Class: App::SharedDatastore

A SharedDatastore service represents a single hash in which scalars or deep references may be stored. (They are automatically serialized for storage.)

It is essentially identical to an MLDBM, but it supports more implementations than an MLDBM (MLDBM is one of the implementations). It also does not support the "tie" interface.

Constructor Methods:

new()

The constructor is inherited from App::Service.

_init()

Public Methods:

set()

    * Signature: $sds->set($key, $value);
    * Signature: $sds->set($key, $value, $options);
    * Param:     $key               scalar
    * Param:     $value             scalar
    * Param:     $options           HASH (optional)
    * Return:    void

    $sds->set($key,$value);
    $options = {
        info_columns => [ "col1", "col2" ],
        info_values  => [ "value1", "value2" ],
    };
    $sds->set($key, $value, $options);

get()

    * Signature: $value = $sds->get($key);
    * Param:     $key               scalar
    * Return:    $value             scalar

    $value = $sds->get($key);

set_ref()

    * Signature: $sds->set_ref($keyref,$valueref);
    * Signature: $sds->set_ref($keyref,$valueref,$options);
    * Param:     $keyref       anything (ref or scalar)
    * Param:     $valueref     anything (ref or scalar)
    * Param:     $options      HASH (optional)
    * Return:    void

    $sds->set_ref($keyref, $valueref);
    $options = {
        info_columns => [ "col1", "col2" ],
        info_values  => [ "value1", "value2" ],
    };
    $sds->set_ref($keyref, $valueref, $options);

get_ref()

    * Signature: $valueref = $sds->get_ref($keyref);
    * Param:     $keyref       anything (ref or scalar)
    * Return:    $valueref     anything (ref or scalar)

    $valueref = $sds->get_ref($keyref);

serialize()

    * Signature: $blob = $sds->serialize($ref);
    * Return:    $ref          any (ref)
    * Return:    $blob         scalar (binary)

    $blob = $sds->serialize($ref);

deserialize()

    * Signature: $ref = $sds->deserialize($blob);
    * Param:     $blob         scalar (binary)
    * Return:    $ref          any (ref)


    $ref = $sds->deserialize($blob);

hashkey()

    * Signature: $hashkey = $sds->hashkey($keyref);
    * Return:    $keyref       any (ref or scalar)
    * Return:    $hashkey      scalar

    $hashkey = $sds->hashkey($keyref);

Protected Methods:

service_type()

Returns "SharedDatastore";

    * Signature: $service_type = App::SharedDatastore->service_type();
    * Param:     void
    * Return:    $service_type  string

    $service_type = $sds->service_type();

ACKNOWLEDGEMENTS

 * Author:  Stephen Adkins <spadkins@gmail.com>
 * License: This is free software. It is licensed under the same terms as Perl itself.

SEE ALSO

App::Context, App::Service