如何为 S3 使用 AWS SDK cpp async API?

How to use AWS SDK cpp async API's for S3?

我希望在我的应用程序中为 s3 使用 aws sdk cpp async api。但是我找不到相同的文档。我经历过 https://github.com/awsdocs/aws-doc-sdk-examples/tree/master/cpp/example_code/s3,但没有包含异步 api 的示例。

例如,我正在尝试使用 PutObjectAsync api。根据此处给出的 api 参考指南 https://sdk.amazonaws.com/cpp/api/LATEST/class_aws_1_1_s3_1_1_s3_client.html#aee8d39c350c5bb66a8d1edcc18df2b78,您需要形成 PutObjectRequest、PutObjectResponseReceivedHandler 和 AsyncCallerContext。

这里没看懂PutObjectResponseReceivedHandler和AsyncCallerContext是怎么构成的。有人可以指导我完成它吗?

GitHub 上的 AWS 代码示例目录现在包含一个 C++ 示例,演示如何将文件异步上传到 Amazon S3。

源代码可以在https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/cpp/example_code/s3/put_object_async.cpp

查看