Skip to content

RFC-2299: Chain based Operator API#2299

Merged
Xuanwo merged 4 commits intomainfrom
new-idea
May 23, 2023
Merged

RFC-2299: Chain based Operator API#2299
Xuanwo merged 4 commits intomainfrom
new-idea

Conversation

@Xuanwo
Copy link
Copy Markdown
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>
Xuanwo added 2 commits May 23, 2023 20:51
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
Copy Markdown
Member

Why not just merge read_with into read?

@Xuanwo
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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