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

Use into_bytes_stream and into_bytes_sink instead of io::copy #4051

Open
Xuanwo opened this issue May 27, 2024 · 2 comments
Open

Use into_bytes_stream and into_bytes_sink instead of io::copy #4051

Xuanwo opened this issue May 27, 2024 · 2 comments
Assignees

Comments

@Xuanwo
Copy link
Contributor

Xuanwo commented May 27, 2024

          @Xuanwo  Does OpenDAL have a recommended way to copy an object between two services? Then I could switch to that approach after this PR. Using `futures::io::copy` requires `AsyncRead` and `AsyncWrite`.

Maybe using streams and sinks?
https://docs.rs/opendal/latest/opendal/struct.Reader.html#method.into_bytes_stream
https://docs.rs/opendal/latest/opendal/struct.Writer.html#method.into_bytes_sink

Originally posted by @evenyag in #4037 (comment)

@evenyag
Copy link
Contributor

evenyag commented May 27, 2024

https://docs.rs/futures/latest/futures/stream/trait.StreamExt.html#method.forward
Then we can use forward to send contents to the sink.

@killme2008
Copy link
Contributor

https://docs.rs/futures/latest/futures/stream/trait.StreamExt.html#method.forward Then we can use forward to send contents to the sink.

It seems a good idea, assign this task to you. It may relate to the write buffer and read cache etc.

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

No branches or pull requests

3 participants