Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Sep 23, 2023

Conversation

silver-ymz
Copy link
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.

@Xuanwo Xuanwo merged commit d93c13d into main Sep 23, 2023
24 checks passed
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants