Coro-Amazon-SimpleDB
view release on metacpan or search on metacpan
lib/Coro/Amazon/SimpleDB.pm view on Meta::CPAN
my $results = $sdb->async_requests(
{ RequestType => 'getAttributes', ItemName => 'the-guide' },
{
RequestType => 'getAttributes',
ItemName => 'heart-of-gold',
AttributeName => [ 'specs', 'price' ],
},
{
RequestType => 'putAttributes',
ItemName => 'marvin',
Attribute => [
{ Name => 'age-in-universe-lifetimes', Value => 2 },
{ Name => 'depression', Value => 'extreme' },
],
},
);
=head2 async_get_items
This is a convenience method for requesting items. It takes a list of
item names and will return the corresponding attributes in a hash ref.
If an item with an identical name (either in the same domain or not)
is requested multiple times it is undefined what the final result will
be.
my @keys = qw( ford arthur zaphod );
my $results = $sdb->async_get_items(@keys);
my $total_heads = sum map { $results->{$_}{head_count} } @keys;
=head2 poll
This method will poll the EV event loop until the pending attribute is
empty. It is usually used internally but is available if users want
to build their own asynchronous calls.
=head2 add_pending
A convenience method to add an item to the pending hash.
=head2 remove_pending
A convenience method to remove an item from the pending hash.
=head2 has_pending
Returns true if there are items in the pending hash.
=head2 bug
A debugging method which will print a message similar to a warn if the
object has its DEBUG attribute set to a true value. If DEBUG is false
it does nothing and immediately returns undef.
=head1 ATTRIBUTES
=head2 aws_access_key
=head2 aws_secret_access_key
These are the AWS credentials providing access to your account. These
should be available on security credentials page of the AWS portal.
=head2 domain_name
A default domain to use for requests. This may be over-ridden in
requests passed as hash refs or objects.
=head2 sdb
The C<Amazon::SimpleDB::Client> object to forward requests through.
This is automatically created when first requested, but may also be
passed in manually.
=head2 pending
A hash ref of pending coros. This is used internally to poll for
completion of all asynchronous requests.
=head2 DEBUG
If set to a true value, the library will output some debugging and
timing information.
=head1 CAVEATS
The Amazon SimpleDB client is required, but is not currently available
via CPAN. It is available here as of 2010-10-20:
http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1136
=head1 AUTHOR
Dave Trischuk, C<< <dtrischuk at cpan.org> >>
=head1 BUGS
Please report any bugs or feature requests to C<bug-coro-amazon-simpledb at rt.cpan.org>, or through
the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Coro-Amazon-SimpleDB>. I will be notified, and then you'll
automatically be notified of progress on your bug as I make changes.
=head1 SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Coro::Amazon::SimpleDB
You can also look for information at:
=over 4
=item * RT: CPAN's request tracker
L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Coro-Amazon-SimpleDB>
=item * AnnoCPAN: Annotated CPAN documentation
L<http://annocpan.org/dist/Coro-Amazon-SimpleDB>
( run in 3.618 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )