Skip to content

getObject是否能支持SetResponseStreamFactory #49

Description

@dongxiao1198

S3的getObject支持自定义SetResponseStreamFactory,在外部提供的buffered stream上直接写response数据,这样可以不用多copy一次
https://github.com/aws/aws-sdk-cpp/blob/main/src/aws-cpp-sdk-core/include/aws/core/AmazonWebServiceRequest.h

Aws::S3::Model::GetObjectRequest request;
request.SetResponseStreamFactory(= { return Aws::New("directReadAt", buf, size); });

cos 、oss也都支持类似的接口:
https://github.com/tencentyun/cos-cpp-sdk-v5/blob/master/include/request/object_req.h : GetObjectByStreamReq
https://github.com/aliyun/aliyun-oss-cpp-sdk/blob/master/sdk/include/alibabacloud/oss/ServiceRequest.h : ServiceRequest
否则在拿到response后还需要copy出去到自己的buffer。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions