aws / aws-sdk-php

Official repository of the AWS SDK for PHP (@awsforphp)
http://aws.amazon.com/sdkforphp
Apache License 2.0
6k stars 1.21k forks source link

Async Plugin support #69

Closed mcaloud closed 11 years ago

mcaloud commented 11 years ago

It would be handy to have clients that easily wired up to Guzzle's Async plugin. In particular I'd like to be able to use the SimpleDbClient asynchronously.

mtdowling commented 11 years ago

Hi. There's no need to add any additional features for any AWS client to support the AsyncPlugin. You can just use the async plugin with the SimpleDbClient object as you normally would.

use Guzzle\Plugin\Async\AsyncPlugin;
$client = $aws->get('SimpleDb');
$client->addSubscriber(new AsyncPlugin());

Edit: This is an example of how to use it, though I highly discourage using it.

danielrhodeswarp commented 11 years ago

Can you please confirm if the Async plugin is supposed to work with the DynamoDB and SWF clients?

bakura10 commented 10 years ago

Hi,

I've tried the Async plugin for sending push notifications using SNS (because those are not really critical I don't care if an error occur for any reason).

However none of the notifications are received. If I remove the async plugin, it works.

mtdowling commented 10 years ago

The AsyncPlugin is not guaranteed to work with anything. I highly discourage using it as it changes the way the SDK works, there's no promise that it actually will be "async", and probably will cause an exception when used with the SDK.

danielrhodeswarp commented 10 years ago

Very useful information and good to know. I did wonder! Thanks for that mtdowling.