Starch::Manager - Entry point for accessing Starch state objects.
See Starch.
This module provides a generic interface to managing the storage of state data.
Typically you will be using the Starch module to create this object.
This class supports method proxies as described in "METHOD PROXIES" in Starch.
The Starch::Store storage backend to use for persisting the state data. A hashref must be passed and it is expected to contain at least a class key and will be converted into a store object automatically.
class
The class can be fully qualified, or relative to the Starch::Store namespace. A leading :: signifies that the store's package name is relative.
Starch::Store
::
More information about stores can be found at "STORES" in Starch.
How long, in seconds, a state should live after the last time it was modified. Defaults to 60 * 60 * 2 (2 hours).
60 * 60 * 2
See "EXPIRATION" in Starch for more information.
Which plugins to apply to the Starch objects, specified as an array ref of plugin names. The plugin names can be fully qualified, or relative to the Starch::Plugin namespace. A leading :: signifies that the plugin's package name is relative.
Starch::Plugin
Plugins can modify nearly any functionality in Starch. More information about plugins, as well as which plugins are available, can be found at "PLUGINS" in Starch.
The root array ref namespace to put starch data in. In most cases this is just prepended to the state ID and used as the key for storing the state data. Defaults to ['starch-state'].
['starch-state']
If you are using the same store for independent application states you may want to namespace them so that you can easly identify which application a particular state belongs to when looking in the store.
The state key to store the "expires" in Starch::State value in. Defaults to __STARCH_EXPIRES__.
__STARCH_EXPIRES__
The state key to store the "modified" in Starch::State value in. Defaults to __STARCH_MODIFIED__.
__STARCH_MODIFIED__
The state key to store the "created" in Starch::State value in. Defaults to __STARCH_CREATED__.
__STARCH_CREATED__
This key is used by stores to mark state data as not to be stored. Defaults to __STARCH_NO_STORE__.
__STARCH_NO_STORE__
This is used by the Starch::Plugin::LogStoreExceptions and Starch::Plugin::ThrottleStore plugins to avoid losing state data in the store when errors or throttling is encountered.
This key is used to artificially mark as state as dirty by incrementing the value of this key. Used by "mark_dirty" in Starch::State.
The Starch::Factory object which applies plugins and handles the construction of the manager, state, and store objects.
The Type::Tiny object to validate the state ID when "state" is called. Defaults to NonEmptySimpleStr.
my $new_state = $starch->state(); my $existing_state = $starch->state( $id );
Returns a new Starch::State (or whatever "state_class" in Starch::Factory returns) object for the specified state ID.
If no ID is specified, or is undef, then an ID will be automatically generated.
Additional arguments can be passed after the ID argument. These extra arguments will be passed to the state object constructor.
Returns a fairly unique string used for seeding "id" in Starch::State.
Generates and returns a new state ID which is a SHA-1 hex digest of calling "state_id_seed".
Clones complex perl data structures. Used internally to build "data" in Starch::State from "original_data" in Starch::State.
Given two bits of data (scalar, array ref, or hash ref) this returns true if the data is different. Used internally by "is_dirty" in Starch::State.
See "SUPPORT" in Starch.
See "AUTHORS" in Starch.
See "COPYRIGHT AND LICENSE" in Starch.
To install Starch, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Starch
CPAN shell
perl -MCPAN -e shell install Starch
For more information on module installation, please visit the detailed CPAN module installation guide.