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: Utilities for doing framed-streaming of car files #39

Merged
merged 4 commits into from
Feb 12, 2024

Conversation

matheus23
Copy link
Member

Previously, the only way we supported streaming car files was by passing something that implements AsyncWrite to car-mirror.

This works well, with e.g. iroh-net and quinn, or tokio's TcpSocket, but it doesn't work well with HTTP libraries like reqwest, because they essentially require either something that implements AsyncRead or streams of bytes.

We already support streaming blocks, but only in raw format, in a way that isn't framed and not in the car file format.

This PR adds a public utility stream_car_frames that transforms such a stream of blocks into a stream of bytes, framed in the car file format.

Also:
- remove `main.rs` from car-mirror crate
- adjust authors
@matheus23 matheus23 self-assigned this Feb 12, 2024
Copy link

codecov bot commented Feb 12, 2024

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (122f369) 50.00% compared to head (35766d5) 48.21%.

❗ Current head 35766d5 differs from pull request most recent head 251bbc4. Consider uploading reports for the commit 251bbc4 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #39      +/-   ##
==========================================
- Coverage   50.00%   48.21%   -1.79%     
==========================================
  Files          13       12       -1     
  Lines         560      560              
  Branches      267      268       +1     
==========================================
- Hits          280      270      -10     
- Misses         62       69       +7     
- Partials      218      221       +3     
Files Coverage Δ
car-mirror/src/common.rs 54.26% <0.00%> (-2.76%) ⬇️

... and 2 files with indirect coverage changes

@matheus23 matheus23 merged commit 3067020 into main Feb 12, 2024
9 checks passed
@matheus23 matheus23 deleted the matheus23/streaming-car-frames branch February 12, 2024 17:13
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.

1 participant