Skip to content

feat(bindings/cpp): make ReaderStream manage the lifetime of Reader#3164

Merged
Xuanwo merged 1 commit intomainfrom
cpp-stream
Sep 23, 2023
Merged

feat(bindings/cpp): make ReaderStream manage the lifetime of Reader#3164
Xuanwo merged 1 commit intomainfrom
cpp-stream

Conversation

@silver-ymz
Copy link
Copy Markdown
Member

Original API seperates the lifetime of Reader and ReaderStream. Users cannot easily manage them. For example, following code will be wrong previously because of stack-use-after-scope.

opendal::ReaderStream return_stream(opendal::Operator &op, std::string_view path) {
  return op.reader(path);
}

With this update, ReaderStream will take the ownership of Reader. Users can ignore Reader when using ReaderStream.

Signed-off-by: silver-ymz <yinmingzhuo@gmail.com>
@github-actions github-actions Bot added the releases-note/feat The PR implements a new feature or has a title that begins with "feat" label Sep 23, 2023
@Xuanwo Xuanwo merged commit d93c13d into main Sep 23, 2023
@Xuanwo Xuanwo deleted the cpp-stream branch September 23, 2023 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

releases-note/feat The PR implements a new feature or has a title that begins with "feat"

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants