workers-rs icon indicating copy to clipboard operation
workers-rs copied to clipboard

[Feature] ObjectBody needs a response_body equivalent when using the http feature

Open robmv opened this issue 1 year ago • 0 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Description

Currently ObjectBody.responseBody() is a more CPU efficient way to stream the body of an R2 object, but it uses the "legacy?" ResponseBody structure and no alternative exist for when the http feature is enabled that uses http-body traits.

Maybe exposing a ReadableStream from ObjectBody with some kind of into_inner() that can be used with worker::Body::new() constructor could be the new API.

robmv avatar Dec 30 '24 01:12 robmv