NAME
EntityModel::Storage::PerlAsync - backend storage interface for EntityModel
VERSION
version 0.015
SYNOPSIS
See EntityModel.
DESCRIPTION
Wrapper around the Perl storage module to defer responses until idle point in an IO::Async loop.
METHODS
new
Subclassed instantiation, requires an IO::Async::Loop passed as the loop
named parameter.
read
Reads the data for the given entity and returns hashref with the appropriate data.
Parameters:
entity - EntityModel::Entity
id - ID to read data from
Callbacks (included in parameter list above):
on_complete - called when the value has been read, includes the value
on_not_found - called if entry not found
Returns $self.
create
Creates new entry for the given EntityModel::Entity.
Parameters:
entity - EntityModel::Entity
data - actual data values
Callbacks (included in parameter list above):
on_complete - called when the value has been created, will be passed the assigned ID
Returns $self.
store
Stores data to the given entity and ID.
Parameters:
entity - EntityModel::Entity
id - ID to store data to
data - actual data values
Callbacks (included in parameter list above):
on_complete - called when the value has been stored, will be passed the assigned ID
Returns $self.
remove
Removes given ID from storage.
Parameters:
entity - EntityModel::Entity
id - ID to store data to
Callbacks (included in parameter list above):
on_complete - called when the value has been removed
Returns $self.
find
Callbacks (included in parameter list above):
on_item - called for each item
on_not_found - called once if no items were found
on_complete - called when no more items are forthcoming (regardless of whether any were found or not)
on_fail - called if there was an error
Returns $self.
AUTHOR
Tom Molesworth <cpan@entitymodel.com>
LICENSE
Copyright Tom Molesworth 2008-2011. Licensed under the same terms as Perl itself.