我的Amazon S3客户端是同步还是异步?(Is my Amazon S3 client synchronous or asynch?)

编程入门 行业动态 更新时间:2024-10-27 16:26:09
我的Amazon S3客户端是同步还是异步?(Is my Amazon S3 client synchronous or asynch?)

这是我的代码

import com.amazonaws.services.s3.AmazonS3; import com.amazonaws.services.s3.AmazonS3Client;

public class AwsS3Helper { private AmazonS3 s3Client; public AwsS3Helper() { try { AWSCredentials credentials = new PropertiesCredentials .... s3Client = new AmazonS3Client( credentials ); s3Client.putObject(putObjectRequest);

我想知道的是,这是异步还是同步操作? 我使用的是DynamoDB,它有2个不同的客户端,一个是异步和同步的,但是在Amazon SDK中没有看到任何其他的S3Client

Here is my code

import com.amazonaws.services.s3.AmazonS3; import com.amazonaws.services.s3.AmazonS3Client;

public class AwsS3Helper { private AmazonS3 s3Client; public AwsS3Helper() { try { AWSCredentials credentials = new PropertiesCredentials .... s3Client = new AmazonS3Client( credentials ); s3Client.putObject(putObjectRequest);

What I would like to know is, is this an asynchronous or synchronous operation? I use DynamoDB and it has 2 different clients, an async and sync one, bu tI don't see any other S3Client in the Amazon SDK

最满意答案

该文档中的声明指向同步操作。 此外,它不会采用任何参数来表示结果的异步指示。

“Amazon S3从不存储部分对象;如果在此调用期间未抛出异常,则存储整个对象。” http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/s3/AmazonS3Client.html#putObject(com.amazonaws.services.s3.model.PutObjectRequest)

This statement, from the documentation is pointing to a synchronous operation. Moreover it doesnt take any parameter for asynch indication of the result.

"Amazon S3 never stores partial objects; if during this call an exception wasn't thrown, the entire object was stored." http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/s3/AmazonS3Client.html#putObject(com.amazonaws.services.s3.model.PutObjectRequest)

更多推荐

本文发布于:2023-07-25 10:49:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1260070.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:客户端   Amazon   asynch   synchronous   client

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!