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

RFC-2299: Chain based Operator API #2299

Merged
merged 4 commits into from
May 23, 2023
Merged

RFC-2299: Chain based Operator API #2299

merged 4 commits into from
May 23, 2023

Conversation

Xuanwo
Copy link
Member

@Xuanwo Xuanwo commented May 23, 2023

This proposal will add chain based API for Operator and BlockingOperator:

from

let bs = op.read_with(
  "path/to/file",
  OpRead::new()
    .with_range(0..=1024)
    .with_if_match("<etag>")
    .with_if_none_match("<etag>")
    .with_override_cache_control("<cache_control>")
    .with_override_content_disposition("<content_disposition>")
  ).await?;

to

let bs = op.read_with("path/to/file")
  .range(0..=1024)
  .if_match("<etag>")
  .if_none_match("<etag>")
  .override_cache_control("<cache_control>")
  .override_content_disposition("<content_disposition>")
  .await?;

Signed-off-by: Xuanwo <github@xuanwo.io>
Signed-off-by: Xuanwo <github@xuanwo.io>
Signed-off-by: Xuanwo <github@xuanwo.io>
@Xuanwo Xuanwo changed the title rfc: Add chain based operator API RFC-2299: Add chain based operator API May 23, 2023
@Xuanwo Xuanwo changed the title RFC-2299: Add chain based operator API RFC-2299: Chain based Operator API May 23, 2023
@Xuanwo Xuanwo requested a review from suyanhanx May 23, 2023 12:56
@suyanhanx
Copy link
Member

Why not just merge read_with into read?

@Xuanwo
Copy link
Member Author

Xuanwo commented May 23, 2023

Why not just merge read_with into read?

Becuase blocking API can't merge, we don't want to provide API like:

let bs = op.read("path/to/file").call()?;

Copy link
Member

@PsiACE PsiACE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@suyanhanx
Copy link
Member

I would like to hear more from the community.

Signed-off-by: Xuanwo <github@xuanwo.io>
@Xuanwo Xuanwo merged commit 583de2f into main May 23, 2023
@Xuanwo Xuanwo deleted the new-idea branch May 23, 2023 13:34
@Xuanwo Xuanwo mentioned this pull request May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants