EntityModel::Gather - asynchronous helper functions for EntityModel
version 0.017
use EntityModel::Gather;
Wrapper class for executing code once data values have been populated.
Given a set of data key => value pairs, this module will request population from each provider. Once all data values are available, the on_ready event is triggered, and the data values are passed to the provided handler. If it is impossible to retrieve data values for some reason, the on_error handler is called instead.
Each of the values passed must be one of the following:
Subclass of EntityModel::Pending - requests callback when data value has been populated
Subclass of EntityModel::EntityBase - requests callback when populated
Scalar value - this will be used as-is
undef - this will be used as-is
Any other value will cause the scalar handling to be used.
Create a new instance. Takes a list of key, value pairs indicating which data values to wait for.
Adds the given key and value to the pending list. If the value is immediately available (simple scalar, for example) then this will pass the value through immediately.
Tom Molesworth <cpan@entitymodel.com>
Copyright Tom Molesworth 2008-2011. Licensed under the same terms as Perl itself.
To install EntityModel, copy and paste the appropriate command in to your terminal.
cpanm
cpanm EntityModel
CPAN shell
perl -MCPAN -e shell install EntityModel
For more information on module installation, please visit the detailed CPAN module installation guide.